summaryrefslogtreecommitdiff
path: root/drivers/iio/pressure
diff options
context:
space:
mode:
authorLars-Peter Clausen <lars@metafoo.de>2021-10-20 11:57:54 +0300
committerJonathan Cameron <Jonathan.Cameron@huawei.com>2021-11-17 20:51:33 +0300
commitba1287e73182f2521d4fc5c0809620ed06652796 (patch)
tree631cc4db446ce7f8ff88d6e1e7b78ec840b0b34d /drivers/iio/pressure
parent4498863cad7befbbd14006e033ae84784a33ae53 (diff)
downloadlinux-ba1287e73182f2521d4fc5c0809620ed06652796.tar.xz
iio: imx7d_adc: Don't pass IIO device to imx7d_adc_{enable,disable}()
The `imx7d_adc_enable()` and `imx7d_adc_disable()` functions are used as the suspend and resume callbacks for the device. When called as suspend/resume functions they are called with the platform_device's device as their parameter. In addition the functions are called on device probe and remove. In this case they are passed the struct device of the IIO device that the driver registers. This works because in the `imx7d_adc_{enable,disable}()` functions the passed struct device is only ever used as a parameter to `dev_get_drvdata()` and `dev_get_drvdata()` returns the same value for the platform device and the IIO device. But for consistency we should pass the same struct device to the `imx7d_adc_{enable,disable}()` in all cases. This will avoid accidental breakage if the device is ever used for something more than `dev_get_drvdata()`. Another motivation is that `dev_get_drvdata()` on the IIO device relies on the IIO core calling `dev_set_drvdata()`. Something we want to remove. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Link: https://lore.kernel.org/r/20211020085754.16654-1-lars@metafoo.de Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Diffstat (limited to 'drivers/iio/pressure')
0 files changed, 0 insertions, 0 deletions