* [PATCH 1/1] smiapp: Don't compile of_read_number() if CONFIG_OF isn't defined
@ 2015-01-27 10:31 Sakari Ailus
0 siblings, 0 replies; only message in thread
From: Sakari Ailus @ 2015-01-27 10:31 UTC (permalink / raw)
To: linux-media
of_read_number() is defined in of.h but does not return an error code, so
that non-of implementation could simply return an error.
Temporarily work around this until of_read_number() can be replaced by
of_property_read_u64_array().
Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi>
---
drivers/media/i2c/smiapp/smiapp-core.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/media/i2c/smiapp/smiapp-core.c b/drivers/media/i2c/smiapp/smiapp-core.c
index b3c8125..d47eff5 100644
--- a/drivers/media/i2c/smiapp/smiapp-core.c
+++ b/drivers/media/i2c/smiapp/smiapp-core.c
@@ -2980,7 +2980,9 @@ static struct smiapp_platform_data *smiapp_get_pdata(struct device *dev)
struct property *prop;
__be32 *val;
uint32_t asize;
+#ifdef CONFIG_OF
unsigned int i;
+#endif
int rval;
if (!dev->of_node)
@@ -3057,8 +3059,10 @@ static struct smiapp_platform_data *smiapp_get_pdata(struct device *dev)
if (IS_ERR(val))
goto out_err;
+#ifdef CONFIG_OF
for (i = 0; i < asize; i++)
pdata->op_sys_clock[i] = of_read_number(val + i * 2, 2);
+#endif
for (; asize > 0; asize--)
dev_dbg(dev, "freq %d: %lld\n", asize - 1,
--
1.7.10.4
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2015-01-27 10:31 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-27 10:31 [PATCH 1/1] smiapp: Don't compile of_read_number() if CONFIG_OF isn't defined Sakari Ailus
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).