iio: amplifiers: hmc425a: Make use of device properties
Subsystems (2)
PATCH 1/1 iio: amplifiers: hmc425a: Make use of device properties
Convert the module to be property provider agnostic and allow it to be used on non-OF platforms.
Signed-off-by Andy Shevchenko <[email protected]>
--- drivers/iio/amplifiers/hmc425a.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/iio/amplifiers/hmc425a.c +3 -3
@@ -11,10 +11,10 @@#include <linux/iio/iio.h> #include <linux/iio/sysfs.h> #include <linux/kernel.h> +#include <linux/mod_devicetable.h> #include <linux/module.h> -#include <linux/of_device.h> -#include <linux/of_platform.h> #include <linux/platform_device.h> +#include <linux/property.h> #include <linux/slab.h> #include <linux/regulator/consumer.h> #include <linux/sysfs.h>
@@ -192,7 +192,7 @@ static int hmc425a_probe(struct platform_device *pdev)return -ENOMEM ; st =iio_priv (indio_dev); - st->type = (uintptr_t )of_device_get_match_data (&pdev->dev); + st->type = (uintptr_t )device_get_match_data (&pdev->dev); st->chip_info = &hmc425a_chip_info_tbl[st->type]; indio_dev->num_channels = st->chip_info->num_channels;
Signature · 1 line
2.34.1
Quoted 4 lines · On Thu, 3 Feb 2022 14:16:24 +0200 Andy Shevchenko…
Convert the module to be property provider agnostic and allow it to be used on non-OF platforms.
Signed-off-by Andy Shevchenko <[email protected]>
Given how simple this one is, I'll apply it now.
Of course, if anyone notices problems I can back it out again as won't be doing any pull requests for at least a week or two.
Applied,
Thanks,
Jonathan
Quoted 30 lines
--- drivers/iio/amplifiers/hmc425a.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)drivers/iio/amplifiers/hmc425a.c +3
-3@@ -11,10 +11,10 @@#include <linux/iio/iio.h> #include <linux/iio/sysfs.h> #include <linux/kernel.h> +#include <linux/mod_devicetable.h> #include <linux/module.h> -#include <linux/of_device.h> -#include <linux/of_platform.h> #include <linux/platform_device.h> +#include <linux/property.h> #include <linux/slab.h> #include <linux/regulator/consumer.h> #include <linux/sysfs.h> @@ -192,7 +192,7 @@ static int hmc425a_probe(struct platform_device *pdev)return -ENOMEM ; st =iio_priv (indio_dev); - st->type = (uintptr_t )of_device_get_match_data (&pdev->dev); + st->type = (uintptr_t )device_get_match_data (&pdev->dev); st->chip_info = &hmc425a_chip_info_tbl[st->type]; indio_dev->num_channels = st->chip_info->num_channels;