Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

media: i2c: rdacm2x: Make use of device properties

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>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>

authored by

Andy Shevchenko and committed by
Hans Verkuil
046c793c 8908792c

+6 -8
+3 -4
drivers/media/i2c/rdacm20.c
··· 16 16 */ 17 17 18 18 #include <linux/delay.h> 19 - #include <linux/fwnode.h> 20 19 #include <linux/init.h> 21 20 #include <linux/i2c.h> 22 21 #include <linux/module.h> 22 + #include <linux/property.h> 23 23 #include <linux/slab.h> 24 24 #include <linux/videodev2.h> 25 25 ··· 575 575 dev->dev = &client->dev; 576 576 dev->serializer.client = client; 577 577 578 - ret = of_property_read_u32_array(client->dev.of_node, "reg", 579 - dev->addrs, 2); 578 + ret = device_property_read_u32_array(dev->dev, "reg", dev->addrs, 2); 580 579 if (ret < 0) { 581 - dev_err(dev->dev, "Invalid DT reg property: %d\n", ret); 580 + dev_err(dev->dev, "Invalid FW reg property: %d\n", ret); 582 581 return -EINVAL; 583 582 } 584 583
+3 -4
drivers/media/i2c/rdacm21.c
··· 11 11 */ 12 12 13 13 #include <linux/delay.h> 14 - #include <linux/fwnode.h> 15 14 #include <linux/init.h> 16 15 #include <linux/i2c.h> 17 16 #include <linux/module.h> 17 + #include <linux/property.h> 18 18 #include <linux/slab.h> 19 19 #include <linux/videodev2.h> 20 20 ··· 551 551 dev->dev = &client->dev; 552 552 dev->serializer.client = client; 553 553 554 - ret = of_property_read_u32_array(client->dev.of_node, "reg", 555 - dev->addrs, 2); 554 + ret = device_property_read_u32_array(dev->dev, "reg", dev->addrs, 2); 556 555 if (ret < 0) { 557 - dev_err(dev->dev, "Invalid DT reg property: %d\n", ret); 556 + dev_err(dev->dev, "Invalid FW reg property: %d\n", ret); 558 557 return -EINVAL; 559 558 } 560 559