From: Philippe De Muyter <phdm@macq.eu>
To: linux-media@vger.kernel.org
Subject: BUG ? v4l2_spi_subdev_init does not produce unique names
Date: Wed, 1 Aug 2018 11:13:41 +0200 [thread overview]
Message-ID: <20180801091341.GA32341@frolo.macqel> (raw)
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
reply other threads:[~2018-08-01 10:58 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180801091341.GA32341@frolo.macqel \
--to=phdm@macq.eu \
--cc=linux-media@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox