diff --git a/drivers/staging/comedi/comedidev.h b/drivers/staging/comedi/comedidev.h index 484321d546dd..1502fc4a85fc 100644 --- a/drivers/staging/comedi/comedidev.h +++ b/drivers/staging/comedi/comedidev.h @@ -324,14 +324,7 @@ static inline unsigned int bytes_per_sample(const struct comedi_subdevice *subd) * known bus type. Set automatically for auto-configured devices. * Automatically set to NULL when detaching hardware device. */ -static inline void comedi_set_hw_dev(struct comedi_device *dev, - struct device *hw_dev) -{ - struct device *old_hw_dev = dev->hw_dev; - - dev->hw_dev = get_device(hw_dev); - put_device(old_hw_dev); -} +int comedi_set_hw_dev(struct comedi_device *dev, struct device *hw_dev); unsigned int comedi_buf_write_alloc(struct comedi_async *, unsigned int); unsigned int comedi_buf_write_free(struct comedi_async *, unsigned int); diff --git a/drivers/staging/comedi/drivers.c b/drivers/staging/comedi/drivers.c index cc6240aa5790..5adf9fc45de4 100644 --- a/drivers/staging/comedi/drivers.c +++ b/drivers/staging/comedi/drivers.c @@ -43,6 +43,16 @@ struct comedi_driver *comedi_drivers; +int comedi_set_hw_dev(struct comedi_device *dev, struct device *hw_dev) +{ + struct device *old_hw_dev = dev->hw_dev; + + dev->hw_dev = get_device(hw_dev); + put_device(old_hw_dev); + return 0; +} +EXPORT_SYMBOL_GPL(comedi_set_hw_dev); + int comedi_alloc_subdevices(struct comedi_device *dev, int num_subdevices) { struct comedi_subdevice *s;