Skip to content

Commit

Permalink
staging: comedi: always set hw_dev during auto-config
Browse files Browse the repository at this point in the history
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: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Ian Abbott authored and Greg Kroah-Hartman committed Oct 22, 2012
1 parent 0a7717d commit 26cbd46
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/staging/comedi/drivers.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 26cbd46

Please sign in to comment.