mirror of
https://github.com/torvalds/linux.git
synced 2026-01-24 23:16:46 +00:00
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>
This commit is contained in:
committed by
Hans Verkuil
parent
8908792cbb
commit
046c793c0e
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user