* BUG ? v4l2_spi_subdev_init does not produce unique names
@ 2018-08-01 9:13 Philippe De Muyter
0 siblings, 0 replies; only message in thread
From: Philippe De Muyter @ 2018-08-01 9:13 UTC (permalink / raw)
To: linux-media
Hello v4l2 gurus,
Sorry for the people who already have read my previous mail. I changed
the subject to make it more sexy :)
Documentation/media/kapi/v4l2-subdev.rst states :
"Afterwards you need to initialize :c:type:`sd <v4l2_subdev>`->name with a
unique name and set the module owner. This is done for you if you use the
i2c helper functions"
I try to write a v4l2 spi driver and use hence v4l2_spi_subdev_init, not
v4l2_i2c_subdev_init.
In v4l2_i2c_subdev_init, subdev name is initialised by
snprintf(sd->name, sizeof(sd->name), "%s %d-%04x",
client->dev.driver->name, i2c_adapter_id(client->adapter),
client->addr);
In v4l2_spi_subdev_init, subdev name is initialised by
strlcpy(sd->name, spi->dev.driver->name, sizeof(sd->name));
This does not give similar results :(
with i2c, subdev name is set as "xxx %d-%04x", giving a unique name to the
subdev.
with spi, subdev name is set as "xxx", giving the same name to all similar
subdevs on the same host
Is that intentional or an oversight, and if so, how should that be fixed ?
Best regards
Philippe
--
Philippe De Muyter +32 2 6101532 Macq SA rue de l'Aeronef 2 B-1140 Bruxelles
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2018-08-01 10:58 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-08-01 9:13 BUG ? v4l2_spi_subdev_init does not produce unique names Philippe De Muyter
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox