When v4l2_i2c_subdev_init is called, dev_name(&client->dev) has already been set. Use it to generate subdev's name instead of recreating it with "%d-%04x". This improves the similarity in subdev's name creation between v4l2_i2c_subdev_init and v4l2_spi_subdev_init. Signed-off-by: Philippe De Muyter <phdm@xxxxxxxxx> --- drivers/media/v4l2-core/v4l2-common.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/media/v4l2-core/v4l2-common.c b/drivers/media/v4l2-core/v4l2-common.c index 5471c6d..b062111 100644 --- a/drivers/media/v4l2-core/v4l2-common.c +++ b/drivers/media/v4l2-core/v4l2-common.c @@ -121,9 +121,8 @@ void v4l2_i2c_subdev_init(struct v4l2_subdev *sd, struct i2c_client *client, v4l2_set_subdevdata(sd, client); i2c_set_clientdata(client, sd); /* initialize name */ - snprintf(sd->name, sizeof(sd->name), "%s %d-%04x", - client->dev.driver->name, i2c_adapter_id(client->adapter), - client->addr); + snprintf(sd->name, sizeof(sd->name), "%s %s", + client->dev.driver->name, dev_name(&client->dev)); } EXPORT_SYMBOL_GPL(v4l2_i2c_subdev_init); -- 1.8.4