提交 26cbd465 编写于 作者: I Ian Abbott 提交者: Greg Kroah-Hartman

staging: comedi: always set hw_dev during auto-config

Auto-configuration (auto-attachment) of USB and PCI comedi devices all
goes through `comedi_auto_config_helper()`.  That is a good place to set
the comedi device's `hw_dev` pointer to the hardware `struct device` via
a call to `comedi_set_hw_dev(comedi_device, hardware_device)` as it may
obviate the need for the low-level comedi driver to make this call.
Signed-off-by: NIan Abbott <abbotti@mev.co.uk>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 0a7717df
......@@ -860,6 +860,7 @@ comedi_auto_config_helper(struct device *hardware_device,
else if (!try_module_get(driver->module))
ret = -EIO;
else {
comedi_set_hw_dev(comedi_dev, hardware_device);
/* set comedi_dev->driver here for attach wrapper */
comedi_dev->driver = driver;
ret = (*attach_wrapper)(comedi_dev, context);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册