提交 7322b320 编写于 作者: I Ian Abbott 提交者: Greg Kroah-Hartman

staging: comedi: comedi_bond: use correct minor device numbers in name

The board name for "comedi_bond" is constructed from a space-separated
list of items of the form "minor:subdevice" where "minor" is a minor
device number and "subdevice" is a subdevice number.  Currently, all the
"minor" device numbers are for the "comedi_bond" device itself and the
"subdevice" numbers are for the bonded devices.  It makes makes more
sense for the "minor" device numbers to come from the bonded devices as
well so that the string is a list of bonded "minor:subdevice" pairs.
Fix it.
Signed-off-by: NIan Abbott <abbotti@mev.co.uk>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 a55de0f4
...@@ -263,8 +263,8 @@ static int do_dev_config(struct comedi_device *dev, struct comedi_devconfig *it) ...@@ -263,8 +263,8 @@ static int do_dev_config(struct comedi_device *dev, struct comedi_devconfig *it)
char buf[20]; char buf[20];
int left = int left =
MAX_BOARD_NAME - strlen(devpriv->name) - 1; MAX_BOARD_NAME - strlen(devpriv->name) - 1;
snprintf(buf, sizeof(buf), "%d:%d ", dev->minor, snprintf(buf, sizeof(buf), "%d:%d ",
bdev->subdev); bdev->minor, bdev->subdev);
buf[sizeof(buf) - 1] = 0; buf[sizeof(buf) - 1] = 0;
strncat(devpriv->name, buf, left); strncat(devpriv->name, buf, left);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册