Commit 3f39fb0f authored by Sakari Ailus's avatar Sakari Ailus Committed by Mauro Carvalho Chehab

[media] smiapp: Use of_property_read_u64_array() to read a 64-bit number array

of_property_read_u64_array() wasn't yet part of the kernel tree when the
functionality was needed. Do use it now.
Signed-off-by: default avatarSakari Ailus <sakari.ailus@iki.fi>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@osg.samsung.com>
parent 152635c6
...@@ -2977,10 +2977,7 @@ static struct smiapp_platform_data *smiapp_get_pdata(struct device *dev) ...@@ -2977,10 +2977,7 @@ static struct smiapp_platform_data *smiapp_get_pdata(struct device *dev)
struct smiapp_platform_data *pdata; struct smiapp_platform_data *pdata;
struct v4l2_of_endpoint bus_cfg; struct v4l2_of_endpoint bus_cfg;
struct device_node *ep; struct device_node *ep;
struct property *prop;
__be32 *val;
uint32_t asize; uint32_t asize;
unsigned int i;
int rval; int rval;
if (!dev->of_node) if (!dev->of_node)
...@@ -3042,23 +3039,12 @@ static struct smiapp_platform_data *smiapp_get_pdata(struct device *dev) ...@@ -3042,23 +3039,12 @@ static struct smiapp_platform_data *smiapp_get_pdata(struct device *dev)
} }
asize /= sizeof(*pdata->op_sys_clock); asize /= sizeof(*pdata->op_sys_clock);
/* rval = of_property_read_u64_array(
* Read a 64-bit array --- this will be replaced with a dev->of_node, "link-frequencies", pdata->op_sys_clock, asize);
* of_property_read_u64_array() once it's merged. if (rval) {
*/ dev_warn(dev, "can't get link-frequencies\n");
prop = of_find_property(dev->of_node, "link-frequencies", NULL);
if (!prop)
goto out_err;
if (!prop->value)
goto out_err;
if (asize * sizeof(*pdata->op_sys_clock) > prop->length)
goto out_err;
val = prop->value;
if (IS_ERR(val))
goto out_err; goto out_err;
}
for (i = 0; i < asize; i++)
pdata->op_sys_clock[i] = of_read_number(val + i * 2, 2);
for (; asize > 0; asize--) for (; asize > 0; asize--)
dev_dbg(dev, "freq %d: %lld\n", asize - 1, dev_dbg(dev, "freq %d: %lld\n", asize - 1,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment