Commit 654be7dd authored by Sakari Ailus's avatar Sakari Ailus Committed by Mauro Carvalho Chehab

media: v4l: i2c: Add a comment not to use static sub-device names in the future

A number of sub-device drivers used a static name for the sub-device, and
thus the media entity. As the entity name must be unique within a media
device, this makes it impossible to have more than one instance of each
device in a media device. This is a rather severe limitation.

Instead of fixing these drivers, add a comment to the drivers noting that
such static names may not be used in the future.

The alternative of fixing the drivers is troublesome as the entity (as
well as sub-device) name is part of the uAPI. Changing that is almost
certain to break something. As these devices are old but no-one has
encountered a problem with the static names, leave it as-is.
Signed-off-by: default avatarSakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+samsung@kernel.org>
parent 41587573
...@@ -987,6 +987,7 @@ static int m5mols_probe(struct i2c_client *client, ...@@ -987,6 +987,7 @@ static int m5mols_probe(struct i2c_client *client,
sd = &info->sd; sd = &info->sd;
v4l2_i2c_subdev_init(sd, client, &m5mols_ops); v4l2_i2c_subdev_init(sd, client, &m5mols_ops);
/* Static name; NEVER use in new drivers! */
strscpy(sd->name, MODULE_NAME, sizeof(sd->name)); strscpy(sd->name, MODULE_NAME, sizeof(sd->name));
sd->flags |= V4L2_SUBDEV_FL_HAS_DEVNODE; sd->flags |= V4L2_SUBDEV_FL_HAS_DEVNODE;
......
...@@ -720,6 +720,7 @@ static int noon010_probe(struct i2c_client *client, ...@@ -720,6 +720,7 @@ static int noon010_probe(struct i2c_client *client,
mutex_init(&info->lock); mutex_init(&info->lock);
sd = &info->sd; sd = &info->sd;
v4l2_i2c_subdev_init(sd, client, &noon010_ops); v4l2_i2c_subdev_init(sd, client, &noon010_ops);
/* Static name; NEVER use in new drivers! */
strscpy(sd->name, MODULE_NAME, sizeof(sd->name)); strscpy(sd->name, MODULE_NAME, sizeof(sd->name));
sd->internal_ops = &noon010_subdev_internal_ops; sd->internal_ops = &noon010_subdev_internal_ops;
......
...@@ -1698,6 +1698,7 @@ static int s5c73m3_probe(struct i2c_client *client, ...@@ -1698,6 +1698,7 @@ static int s5c73m3_probe(struct i2c_client *client,
return ret; return ret;
v4l2_i2c_subdev_init(oif_sd, client, &oif_subdev_ops); v4l2_i2c_subdev_init(oif_sd, client, &oif_subdev_ops);
/* Static name; NEVER use in new drivers! */
strscpy(oif_sd->name, "S5C73M3-OIF", sizeof(oif_sd->name)); strscpy(oif_sd->name, "S5C73M3-OIF", sizeof(oif_sd->name));
oif_sd->internal_ops = &oif_internal_ops; oif_sd->internal_ops = &oif_internal_ops;
......
...@@ -954,6 +954,7 @@ static int s5k4ecgx_probe(struct i2c_client *client, ...@@ -954,6 +954,7 @@ static int s5k4ecgx_probe(struct i2c_client *client,
sd = &priv->sd; sd = &priv->sd;
/* Registering subdev */ /* Registering subdev */
v4l2_i2c_subdev_init(sd, client, &s5k4ecgx_ops); v4l2_i2c_subdev_init(sd, client, &s5k4ecgx_ops);
/* Static name; NEVER use in new drivers! */
strscpy(sd->name, S5K4ECGX_DRIVER_NAME, sizeof(sd->name)); strscpy(sd->name, S5K4ECGX_DRIVER_NAME, sizeof(sd->name));
sd->internal_ops = &s5k4ecgx_subdev_internal_ops; sd->internal_ops = &s5k4ecgx_subdev_internal_ops;
......
...@@ -1576,6 +1576,7 @@ static int s5k6aa_probe(struct i2c_client *client, ...@@ -1576,6 +1576,7 @@ static int s5k6aa_probe(struct i2c_client *client,
sd = &s5k6aa->sd; sd = &s5k6aa->sd;
v4l2_i2c_subdev_init(sd, client, &s5k6aa_subdev_ops); v4l2_i2c_subdev_init(sd, client, &s5k6aa_subdev_ops);
/* Static name; NEVER use in new drivers! */
strscpy(sd->name, DRIVER_NAME, sizeof(sd->name)); strscpy(sd->name, DRIVER_NAME, sizeof(sd->name));
sd->internal_ops = &s5k6aa_subdev_internal_ops; sd->internal_ops = &s5k6aa_subdev_internal_ops;
......
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