[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1446025735-26849-3-git-send-email-josh.wu@atmel.com>
Date: Wed, 28 Oct 2015 17:48:53 +0800
From: Josh Wu <josh.wu@...el.com>
To: Guennadi Liakhovetski <g.liakhovetski@....de>,
Laurent Pinchart <laurent.pinchart@...asonboard.com>
CC: Linux Media Mailing List <linux-media@...r.kernel.org>,
Josh Wu <josh.wu@...el.com>,
Mauro Carvalho Chehab <mchehab@....samsung.com>,
<linux-kernel@...r.kernel.org>
Subject: [PATCH 2/4] v4l2-clk: add new macro for v4l2_clk_name_of()
This macro is used to generate a OF string for a v4l2 clock.
Signed-off-by: Josh Wu <josh.wu@...el.com>
---
drivers/media/platform/soc_camera/soc_camera.c | 4 ++--
include/media/v4l2-clk.h | 3 +++
2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/drivers/media/platform/soc_camera/soc_camera.c b/drivers/media/platform/soc_camera/soc_camera.c
index d165bff..673f1d4 100644
--- a/drivers/media/platform/soc_camera/soc_camera.c
+++ b/drivers/media/platform/soc_camera/soc_camera.c
@@ -1680,8 +1680,8 @@ static int soc_of_bind(struct soc_camera_host *ici,
v4l2_clk_name_i2c(clk_name, sizeof(clk_name),
client->adapter->nr, client->addr);
else
- snprintf(clk_name, sizeof(clk_name), "of-%s",
- of_node_full_name(remote));
+ v4l2_clk_name_of(clk_name, sizeof(clk_name),
+ of_node_full_name(remote));
icd->clk = v4l2_clk_register(&soc_camera_clk_ops, clk_name, icd);
if (IS_ERR(icd->clk)) {
diff --git a/include/media/v4l2-clk.h b/include/media/v4l2-clk.h
index 3ef6e3d..34891ea 100644
--- a/include/media/v4l2-clk.h
+++ b/include/media/v4l2-clk.h
@@ -68,4 +68,7 @@ static inline struct v4l2_clk *v4l2_clk_register_fixed(const char *dev_id,
#define v4l2_clk_name_i2c(name, size, adap, client) snprintf(name, size, \
"%d-%04x", adap, client)
+#define v4l2_clk_name_of(name, size, of_full_name) snprintf(name, size, \
+ "of-%s", of_full_name)
+
#endif
--
1.9.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists