* [PATCH v2 1/1] media: i2c: rdacm2x: Make use of device properties
@ 2025-03-31 8:35 Andy Shevchenko
2025-04-01 0:18 ` Laurent Pinchart
2025-05-02 14:13 ` Andy Shevchenko
0 siblings, 2 replies; 3+ messages in thread
From: Andy Shevchenko @ 2025-03-31 8:35 UTC (permalink / raw)
To: linux-media, linux-kernel
Cc: acopo Mondi, Kieran Bingham, Laurent Pinchart,
Mauro Carvalho Chehab, Andy Shevchenko
Convert the module to be property provider agnostic and allow
it to be used on non-OF platforms.
Reviewed-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
v2: fixed error message wording (Kieran)
drivers/media/i2c/rdacm20.c | 7 +++----
drivers/media/i2c/rdacm21.c | 7 +++----
2 files changed, 6 insertions(+), 8 deletions(-)
diff --git a/drivers/media/i2c/rdacm20.c b/drivers/media/i2c/rdacm20.c
index b8bd8354d100..52e8e2620b4d 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,10 +575,9 @@ 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(dev->dev, "reg", dev->addrs, 2);
if (ret < 0) {
- dev_err(dev->dev, "Invalid DT reg property: %d\n", ret);
+ dev_err(dev->dev, "Invalid FW reg property: %d\n", ret);
return -EINVAL;
}
diff --git a/drivers/media/i2c/rdacm21.c b/drivers/media/i2c/rdacm21.c
index 3e22df36354f..bcab462708c7 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,10 +551,9 @@ 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(dev->dev, "reg", dev->addrs, 2);
if (ret < 0) {
- dev_err(dev->dev, "Invalid DT reg property: %d\n", ret);
+ dev_err(dev->dev, "Invalid FW reg property: %d\n", ret);
return -EINVAL;
}
--
2.47.2
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH v2 1/1] media: i2c: rdacm2x: Make use of device properties
2025-03-31 8:35 [PATCH v2 1/1] media: i2c: rdacm2x: Make use of device properties Andy Shevchenko
@ 2025-04-01 0:18 ` Laurent Pinchart
2025-05-02 14:13 ` Andy Shevchenko
1 sibling, 0 replies; 3+ messages in thread
From: Laurent Pinchart @ 2025-04-01 0:18 UTC (permalink / raw)
To: Andy Shevchenko
Cc: linux-media, linux-kernel, acopo Mondi, Kieran Bingham,
Mauro Carvalho Chehab
Hi Andy,
Thank you for the patch.
On Mon, Mar 31, 2025 at 11:35:04AM +0300, Andy Shevchenko wrote:
> Convert the module to be property provider agnostic and allow
> it to be used on non-OF platforms.
>
> Reviewed-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
> ---
>
> v2: fixed error message wording (Kieran)
>
> drivers/media/i2c/rdacm20.c | 7 +++----
> drivers/media/i2c/rdacm21.c | 7 +++----
> 2 files changed, 6 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/media/i2c/rdacm20.c b/drivers/media/i2c/rdacm20.c
> index b8bd8354d100..52e8e2620b4d 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,10 +575,9 @@ 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(dev->dev, "reg", dev->addrs, 2);
> if (ret < 0) {
> - dev_err(dev->dev, "Invalid DT reg property: %d\n", ret);
> + dev_err(dev->dev, "Invalid FW reg property: %d\n", ret);
> return -EINVAL;
> }
>
> diff --git a/drivers/media/i2c/rdacm21.c b/drivers/media/i2c/rdacm21.c
> index 3e22df36354f..bcab462708c7 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,10 +551,9 @@ 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(dev->dev, "reg", dev->addrs, 2);
> if (ret < 0) {
> - dev_err(dev->dev, "Invalid DT reg property: %d\n", ret);
> + dev_err(dev->dev, "Invalid FW reg property: %d\n", ret);
> return -EINVAL;
> }
>
--
Regards,
Laurent Pinchart
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v2 1/1] media: i2c: rdacm2x: Make use of device properties
2025-03-31 8:35 [PATCH v2 1/1] media: i2c: rdacm2x: Make use of device properties Andy Shevchenko
2025-04-01 0:18 ` Laurent Pinchart
@ 2025-05-02 14:13 ` Andy Shevchenko
1 sibling, 0 replies; 3+ messages in thread
From: Andy Shevchenko @ 2025-05-02 14:13 UTC (permalink / raw)
To: linux-media, linux-kernel
Cc: acopo Mondi, Kieran Bingham, Laurent Pinchart,
Mauro Carvalho Chehab
On Mon, Mar 31, 2025 at 11:35:04AM +0300, Andy Shevchenko wrote:
> Convert the module to be property provider agnostic and allow
> it to be used on non-OF platforms.
Any comments? Can it be applied?
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-05-02 14:13 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-31 8:35 [PATCH v2 1/1] media: i2c: rdacm2x: Make use of device properties Andy Shevchenko
2025-04-01 0:18 ` Laurent Pinchart
2025-05-02 14:13 ` Andy Shevchenko
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox