diff options
author | Rob Herring <robh@kernel.org> | 2023-10-06 17:44:39 -0500 |
---|---|---|
committer | Jonathan Cameron <Jonathan.Cameron@huawei.com> | 2023-10-14 17:18:36 +0100 |
commit | 89a1d2f064d2ae77a9cd6a8c7ac42b3c1647efa5 (patch) | |
tree | ef58634d77892dcf2a641cf5f70fc95d26ff0f9a /drivers/iio/adc/twl6030-gpadc.c | |
parent | 349c1b49ffafd9f0e49153599efd5cd251ba60b1 (diff) | |
download | lwn-89a1d2f064d2ae77a9cd6a8c7ac42b3c1647efa5.tar.gz lwn-89a1d2f064d2ae77a9cd6a8c7ac42b3c1647efa5.zip |
iio: Use device_get_match_data()
Use preferred device_get_match_data() instead of of_match_device() to
get the driver match data. With this, adjust the includes to explicitly
include the correct headers.
Signed-off-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20231006224440.442864-1-robh@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Diffstat (limited to 'drivers/iio/adc/twl6030-gpadc.c')
-rw-r--r-- | drivers/iio/adc/twl6030-gpadc.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/drivers/iio/adc/twl6030-gpadc.c b/drivers/iio/adc/twl6030-gpadc.c index 224e9cb5e147..78bf55438b2c 100644 --- a/drivers/iio/adc/twl6030-gpadc.c +++ b/drivers/iio/adc/twl6030-gpadc.c @@ -16,9 +16,10 @@ */ #include <linux/interrupt.h> #include <linux/kernel.h> +#include <linux/mod_devicetable.h> #include <linux/module.h> #include <linux/platform_device.h> -#include <linux/of_platform.h> +#include <linux/property.h> #include <linux/mfd/twl.h> #include <linux/iio/iio.h> #include <linux/iio/sysfs.h> @@ -879,17 +880,14 @@ static int twl6030_gpadc_probe(struct platform_device *pdev) struct device *dev = &pdev->dev; struct twl6030_gpadc_data *gpadc; const struct twl6030_gpadc_platform_data *pdata; - const struct of_device_id *match; struct iio_dev *indio_dev; int irq; int ret; - match = of_match_device(of_twl6030_match_tbl, dev); - if (!match) + pdata = device_get_match_data(&pdev->dev); + if (!pdata) return -EINVAL; - pdata = match->data; - indio_dev = devm_iio_device_alloc(dev, sizeof(*gpadc)); if (!indio_dev) return -ENOMEM; |