[media] v4l2-clk: add new definition: V4L2_CLK_NAME_SIZE
authorJosh Wu <josh.wu@atmel.com>
Wed, 28 Oct 2015 09:48:54 +0000 (07:48 -0200)
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>
Tue, 17 Nov 2015 17:19:11 +0000 (15:19 -0200)
Make all v4l2-clk's clock name use V4L2_CLK_NAME_SIZE definition.

In future, if the string is increased we just need to change the
V4L2_CLK_NAME_SIZE once.

Signed-off-by: Josh Wu <josh.wu@atmel.com>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
drivers/media/platform/soc_camera/soc_camera.c
drivers/media/usb/em28xx/em28xx-camera.c
include/media/v4l2-clk.h

index 979ff9c8c712cdd7353295ab14a3dc253d81de3a..cc84c6d6a701ce249722010ed514c1e4a4630def 100644 (file)
@@ -1360,7 +1360,7 @@ static int soc_camera_i2c_init(struct soc_camera_device *icd,
        struct soc_camera_host_desc *shd = &sdesc->host_desc;
        struct i2c_adapter *adap;
        struct v4l2_subdev *subdev;
-       char clk_name[V4L2_SUBDEV_NAME_SIZE];
+       char clk_name[V4L2_CLK_NAME_SIZE];
        int ret;
 
        /* First find out how we link the main client */
@@ -1526,7 +1526,7 @@ static int scan_async_group(struct soc_camera_host *ici,
        struct soc_camera_async_client *sasc;
        struct soc_camera_device *icd;
        struct soc_camera_desc sdesc = {.host_desc.bus_id = ici->nr,};
-       char clk_name[V4L2_SUBDEV_NAME_SIZE];
+       char clk_name[V4L2_CLK_NAME_SIZE];
        unsigned int i;
        int ret;
 
@@ -1632,7 +1632,7 @@ static int soc_of_bind(struct soc_camera_host *ici,
        struct soc_camera_async_client *sasc;
        struct soc_of_info *info;
        struct i2c_client *client;
-       char clk_name[V4L2_SUBDEV_NAME_SIZE + 32];
+       char clk_name[V4L2_CLK_NAME_SIZE];
        int ret;
 
        /* allocate a new subdev and add match info to it */
index 104d4a5a06494c95cc594e221657ea0d6dc4ed73..b58acd3fcd9918368b2eadac79d61a5f64d80b38 100644 (file)
@@ -322,7 +322,7 @@ int em28xx_detect_sensor(struct em28xx *dev)
 
 int em28xx_init_camera(struct em28xx *dev)
 {
-       char clk_name[V4L2_SUBDEV_NAME_SIZE];
+       char clk_name[V4L2_CLK_NAME_SIZE];
        struct i2c_client *client = &dev->i2c_client[dev->def_i2c_bus];
        struct i2c_adapter *adap = &dev->i2c_adap[dev->def_i2c_bus];
        struct em28xx_v4l2 *v4l2 = dev->v4l2;
index 34891ea5f3291c4ebe7971d5ae5bd5774d3f410e..2b94662d005c4991094096751a635220bdbb15f4 100644 (file)
@@ -65,6 +65,8 @@ static inline struct v4l2_clk *v4l2_clk_register_fixed(const char *dev_id,
        return __v4l2_clk_register_fixed(dev_id, rate, THIS_MODULE);
 }
 
+#define V4L2_CLK_NAME_SIZE 64
+
 #define v4l2_clk_name_i2c(name, size, adap, client) snprintf(name, size, \
                          "%d-%04x", adap, client)