public inbox for devicetree@vger.kernel.org
 help / color / mirror / Atom feed
From: Sakari Ailus <sakari.ailus@iki.fi>
To: Alexander Stein <alexander.stein@ew.tq-group.com>
Cc: "Paul J . Murphy" <paul.j.murphy@intel.com>,
	Daniele Alessandrelli <daniele.alessandrelli@intel.com>,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	Rob Herring <robh+dt@kernel.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	linux-media@vger.kernel.org, devicetree@vger.kernel.org
Subject: Re: [PATCH v3 6/7] media: i2c: ov9282: Set v4l2 subdev name according to sensor model
Date: Thu, 28 Jul 2022 14:47:56 +0300	[thread overview]
Message-ID: <YuJ3bMxaIp9tEgsN@valkosipuli.retiisi.eu> (raw)
In-Reply-To: <5587982.DvuYhMxLoT@steina-w>

Hi Alexander,

On Mon, Jul 25, 2022 at 08:38:57AM +0200, Alexander Stein wrote:
> Hi Sakari,
> 
> Am Freitag, 22. Juli 2022, 15:50:30 CEST schrieb Sakari Ailus:
> > Hi Alexander,
> > 
> > On Fri, Jul 22, 2022 at 03:19:46PM +0200, Alexander Stein wrote:
> > > To distinguish ov9281 & ov9282 the name has to be explicitly set.
> > > i2c_client already has the name parsed from the compatible.
> > > 
> > > Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com>
> > > ---
> > > 
> > >  drivers/media/i2c/ov9282.c | 1 +
> > >  1 file changed, 1 insertion(+)
> > > 
> > > diff --git a/drivers/media/i2c/ov9282.c b/drivers/media/i2c/ov9282.c
> > > index 352dbe21a902..dbc0a4cd060f 100644
> > > --- a/drivers/media/i2c/ov9282.c
> > > +++ b/drivers/media/i2c/ov9282.c
> > > @@ -1047,6 +1047,7 @@ static int ov9282_probe(struct i2c_client *client)
> > > 
> > >  	/* Initialize subdev */
> > >  	v4l2_i2c_subdev_init(&ov9282->sd, client, &ov9282_subdev_ops);
> > > 
> > > +	v4l2_i2c_subdev_set_name(&ov9282->sd, client, client->name, NULL);
> > 
> > Could you instead do this based on the compatible string in the driver,
> > using device_get_match_data()? The approach works on non-OF systems, too.
> 
> I actually don't like doing the same as of_modalias_node() is doing.
> Until non-OF support is added (if ever), I don't see any benefit in doing so 
> right now.

client->name will be wrong on un-OF; putting this string to device match
data is a better option. It'll be about the same number of lines, too.

-- 
Sakari Ailus

  reply	other threads:[~2022-07-28 11:48 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-22 13:19 [PATCH v3 0/7] OV9281 support Alexander Stein
2022-07-22 13:19 ` [PATCH v3 1/7] media: i2c: ov9282: remove unused and unset i2c_client member Alexander Stein
2022-07-22 13:19 ` [PATCH v3 2/7] media: dt-bindings: media: Add compatible for ov9281 Alexander Stein
2022-07-22 13:19 ` [PATCH v3 3/7] media: i2c: ov9282: Add ov9281 compatible Alexander Stein
2022-07-22 13:19 ` [PATCH v3 4/7] media: dt-bindings: media: ov9282: Add power supply properties Alexander Stein
2022-07-22 13:19 ` [PATCH v3 5/7] media: i2c: ov9282: Add regulator support Alexander Stein
2022-07-22 13:19 ` [PATCH v3 6/7] media: i2c: ov9282: Set v4l2 subdev name according to sensor model Alexander Stein
2022-07-22 13:50   ` Sakari Ailus
2022-07-25  6:38     ` Alexander Stein
2022-07-28 11:47       ` Sakari Ailus [this message]
2022-07-22 13:19 ` [PATCH v3 7/7] media: i2c: ov9282: Add regmap support Alexander Stein
2022-07-22 13:46   ` 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=YuJ3bMxaIp9tEgsN@valkosipuli.retiisi.eu \
    --to=sakari.ailus@iki.fi \
    --cc=alexander.stein@ew.tq-group.com \
    --cc=daniele.alessandrelli@intel.com \
    --cc=devicetree@vger.kernel.org \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=paul.j.murphy@intel.com \
    --cc=robh+dt@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