diff options
author | Jonathan Cameron <Jonathan.Cameron@huawei.com> | 2024-02-18 17:27:31 +0000 |
---|---|---|
committer | Jonathan Cameron <Jonathan.Cameron@huawei.com> | 2024-02-26 22:00:24 +0000 |
commit | 53d5fab570eeb6074817c50f636bb71e210e12dc (patch) | |
tree | 9b30a016d8b50bdf92c8543b53a84f8470dcfaf5 | |
parent | b39f01ffa5cc048bb700fc7254107a064fa1a622 (diff) | |
download | iio-53d5fab570eeb6074817c50f636bb71e210e12dc.tar.gz |
iio: adc: hx711: Switch from of specific to fwnode property handling.
Allows driver to be used with other firmware types and removes an
example that might be copied into new IIO drivers.
Cc: Andreas Klinger <ak@it-klinger.de>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20240218172731.1023367-9-jic23@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-rw-r--r-- | drivers/iio/adc/hx711.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/iio/adc/hx711.c b/drivers/iio/adc/hx711.c index c80c55fb8c6ce..fef97c1d226a5 100644 --- a/drivers/iio/adc/hx711.c +++ b/drivers/iio/adc/hx711.c @@ -7,7 +7,7 @@ #include <linux/err.h> #include <linux/kernel.h> #include <linux/module.h> -#include <linux/of.h> +#include <linux/mod_devicetable.h> #include <linux/platform_device.h> #include <linux/property.h> #include <linux/slab.h> @@ -459,7 +459,6 @@ static const struct iio_chan_spec hx711_chan_spec[] = { static int hx711_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; - struct device_node *np = dev->of_node; struct hx711_data *hx711_data; struct iio_dev *indio_dev; int ret; @@ -533,7 +532,7 @@ static int hx711_probe(struct platform_device *pdev) hx711_data->gain_chan_a = 128; hx711_data->clock_frequency = 400000; - ret = of_property_read_u32(np, "clock-frequency", + ret = device_property_read_u32(&pdev->dev, "clock-frequency", &hx711_data->clock_frequency); /* |