BUG ? v4l2_spi_subdev_init does not produce unique names

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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



[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux