From: Alexander Stein <alexander.stein@ew.tq-group.com>
To: Sakari Ailus <sakari.ailus@linux.intel.com>
Cc: Mauro Carvalho Chehab <mchehab@kernel.org>,
Hans Verkuil <hans.verkuil@cisco.com>,
linux-media@vger.kernel.org
Subject: Re: Re: [PATCH 1/1] media: v4l2-core: v4l2-i2c: Fix default device name
Date: Wed, 20 Jul 2022 09:54:40 +0200 [thread overview]
Message-ID: <44845826.fMDQidcC6G@steina-w> (raw)
In-Reply-To: <YtWo33+6J9DBtG0z@paasikivi.fi.intel.com>
Hi Sakari,
thanks for the feedback.
Am Montag, 18. Juli 2022, 20:39:27 CEST schrieb Sakari Ailus:
> Hi Alexander,
>
> Thanks for the patch.
>
> On Mon, Jul 18, 2022 at 02:01:51PM +0200, Alexander Stein wrote:
> > Documentation to v4l2_i2c_subdev_set_name says I²C device name if
> > devname parameter is NULL. But instead the I²C driver name is assigned.
> > Fix this by actually using the i2c_client->name for the subdev name.
> >
> > Fixes: 0658293012af ("media: v4l: subdev: Add a function to set an I²C
> > sub-device's name") Signed-off-by: Alexander Stein
> > <alexander.stein@ew.tq-group.com>
> > ---
> > Having a sensor node in DT with compatible = "ovti,ov9281" the subdev
> > name is "ov9282" without this patch. With this patch applied it is
> > "ov9281". The i2c_client->name is "ov9281" in every case.
> >
> > drivers/media/v4l2-core/v4l2-i2c.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/media/v4l2-core/v4l2-i2c.c
> > b/drivers/media/v4l2-core/v4l2-i2c.c index b4acca75644b..90c3c799317a
> > 100644
> > --- a/drivers/media/v4l2-core/v4l2-i2c.c
> > +++ b/drivers/media/v4l2-core/v4l2-i2c.c
> > @@ -33,7 +33,7 @@ void v4l2_i2c_subdev_set_name(struct v4l2_subdev *sd,
> >
> > const char *devname, const char
*postfix)
> >
> > {
> >
> > if (!devname)
> >
> > - devname = client->dev.driver->name;
> > + devname = client->name;
>
> This would work OF somehow but not on ACPI. At the moment, at least, I think
> this information needs to come from the driver itself.
I've not much experience regarding ACPI, nor can I test anything. Which
information from ACPI should be used as devname? AFAICS i2c_acpi_fill_info
need to be modified to set info->type as well. This should fix the ACPI case.
Nevertheless currently either the documentation or the implementation needs a
fix, they don't match. You can also opt to driver name in case client->name is
empty. Is this acceptable?
Best regards,
Alexander
next prev parent reply other threads:[~2022-07-20 7:54 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-18 12:01 [PATCH 1/1] media: v4l2-core: v4l2-i2c: Fix default device name Alexander Stein
2022-07-18 18:39 ` Sakari Ailus
2022-07-20 7:54 ` Alexander Stein [this message]
2022-07-22 6:28 ` Sakari Ailus
2022-07-22 7:09 ` Alexander Stein
2022-07-22 7:31 ` Sakari Ailus
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=44845826.fMDQidcC6G@steina-w \
--to=alexander.stein@ew.tq-group.com \
--cc=hans.verkuil@cisco.com \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@kernel.org \
--cc=sakari.ailus@linux.intel.com \
/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