mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-24 01:41:39 +00:00
media: v4l2-common: v4l2_spi_subdev_init : generate unique name
While v4l2_i2c_subdev_init does give a unique name to the subdev, matching the one appearing in dmesg for messages generated by dev_info and friends (e.g. imx185 30-0010), v4l2_spi_subdev_init does a poor job, copying only the driver name, but not the dev_name(), yielding e.g. "imx185", but missing the "spi1.1" part, and not generating a unique name. Fix that. Signed-off-by: Philippe De Muyter <phdm@macqel.be> Acked-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
This commit is contained in:
parent
c4189ffb8c
commit
447d668553
1 changed files with 2 additions and 1 deletions
|
@ -255,7 +255,8 @@ void v4l2_spi_subdev_init(struct v4l2_subdev *sd, struct spi_device *spi,
|
|||
v4l2_set_subdevdata(sd, spi);
|
||||
spi_set_drvdata(spi, sd);
|
||||
/* initialize name */
|
||||
strscpy(sd->name, spi->dev.driver->name, sizeof(sd->name));
|
||||
snprintf(sd->name, sizeof(sd->name), "%s %s",
|
||||
spi->dev.driver->name, dev_name(&spi->dev));
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(v4l2_spi_subdev_init);
|
||||
|
||||
|
|
Loading…
Reference in a new issue