diff mbox series

[v1,1/1] media: i2c: rdacm2x: Make use of device properties

Message ID 20250331073435.3992597-1-andriy.shevchenko@linux.intel.com
State New
Headers show
Series [v1,1/1] media: i2c: rdacm2x: Make use of device properties | expand

Commit Message

Andy Shevchenko March 31, 2025, 7:34 a.m. UTC
Convert the module to be property provider agnostic and allow
it to be used on non-OF platforms.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/media/i2c/rdacm20.c | 5 ++---
 drivers/media/i2c/rdacm21.c | 5 ++---
 2 files changed, 4 insertions(+), 6 deletions(-)
diff mbox series

Patch

diff --git a/drivers/media/i2c/rdacm20.c b/drivers/media/i2c/rdacm20.c
index b8bd8354d100..dcab63d19baf 100644
--- a/drivers/media/i2c/rdacm20.c
+++ b/drivers/media/i2c/rdacm20.c
@@ -16,10 +16,10 @@ 
  */
 
 #include <linux/delay.h>
-#include <linux/fwnode.h>
 #include <linux/init.h>
 #include <linux/i2c.h>
 #include <linux/module.h>
+#include <linux/property.h>
 #include <linux/slab.h>
 #include <linux/videodev2.h>
 
@@ -575,8 +575,7 @@  static int rdacm20_probe(struct i2c_client *client)
 	dev->dev = &client->dev;
 	dev->serializer.client = client;
 
-	ret = of_property_read_u32_array(client->dev.of_node, "reg",
-					 dev->addrs, 2);
+	ret = device_property_read_u32_array(&client->dev, "reg", dev->addrs, 2);
 	if (ret < 0) {
 		dev_err(dev->dev, "Invalid DT reg property: %d\n", ret);
 		return -EINVAL;
diff --git a/drivers/media/i2c/rdacm21.c b/drivers/media/i2c/rdacm21.c
index 3e22df36354f..5ea6988de48b 100644
--- a/drivers/media/i2c/rdacm21.c
+++ b/drivers/media/i2c/rdacm21.c
@@ -11,10 +11,10 @@ 
  */
 
 #include <linux/delay.h>
-#include <linux/fwnode.h>
 #include <linux/init.h>
 #include <linux/i2c.h>
 #include <linux/module.h>
+#include <linux/property.h>
 #include <linux/slab.h>
 #include <linux/videodev2.h>
 
@@ -551,8 +551,7 @@  static int rdacm21_probe(struct i2c_client *client)
 	dev->dev = &client->dev;
 	dev->serializer.client = client;
 
-	ret = of_property_read_u32_array(client->dev.of_node, "reg",
-					 dev->addrs, 2);
+	ret = device_property_read_u32_array(&client->dev, "reg", dev->addrs, 2);
 	if (ret < 0) {
 		dev_err(dev->dev, "Invalid DT reg property: %d\n", ret);
 		return -EINVAL;