public inbox for linux-i2c@vger.kernel.org
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Sebastian Reichel <sebastian.reichel@collabora.com>
Cc: "Bence Csókás" <csokas.bence@prolan.hu>,
	"Wolfram Sang" <wsa+renesas@sang-engineering.com>,
	linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-pm@vger.kernel.org, "Samuel Holland" <samuel@sholland.org>
Subject: Re: [PATCH v1 1/2] power: ip5xxx_power: Make use of i2c_get_match_data()
Date: Thu, 13 Feb 2025 11:56:41 +0200	[thread overview]
Message-ID: <Z63B2dxEd0g1ppra@smile.fi.intel.com> (raw)
In-Reply-To: <hnfdjznbvqbstcqd7rgrukqqdv7uasexojnujz63qgjnv7pja3@z4lanwhk4i6b>

On Wed, Feb 12, 2025 at 06:07:19PM +0100, Sebastian Reichel wrote:
> On Wed, Feb 12, 2025 at 06:46:23PM +0200, Andy Shevchenko wrote:
> > Get matching data in one step by switching to use i2c_get_match_data().

...

> Acked-by: Sebastian Reichel <sebastian.reichel@collabora.com>

Thank you!

...

> >  static int ip5xxx_power_probe(struct i2c_client *client)
> >  {
> > -	const struct ip5xxx_regfield_config *fields = &ip51xx_fields;
> > +	const struct ip5xxx_regfield_config *fields;
> >  	struct power_supply_config psy_cfg = {};
> >  	struct device *dev = &client->dev;

> >  	const struct of_device_id *of_id;

Seems I forgot to drop this (unused) variable.

> > @@ -843,9 +843,7 @@ static int ip5xxx_power_probe(struct i2c_client *client)
> >  	if (IS_ERR(ip5xxx->regmap))
> >  		return PTR_ERR(ip5xxx->regmap);
> >  
> > -	of_id = i2c_of_match_device(dev->driver->of_match_table, client);
> > -	if (of_id)
> > -		fields = (const struct ip5xxx_regfield_config *)of_id->data;
> > +	fields = i2c_get_match_data(client) ?: &ip51xx_fields;

-- 
With Best Regards,
Andy Shevchenko



  reply	other threads:[~2025-02-13  9:56 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-12 16:46 [PATCH v1 0/2] i2c: Reduce use of i2c_of_match_device() Andy Shevchenko
2025-02-12 16:46 ` [PATCH v1 1/2] power: ip5xxx_power: Make use of i2c_get_match_data() Andy Shevchenko
2025-02-12 17:07   ` Sebastian Reichel
2025-02-13  9:56     ` Andy Shevchenko [this message]
2025-02-12 16:46 ` [PATCH v1 2/2] i2c: Unexport i2c_of_match_device() Andy Shevchenko

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=Z63B2dxEd0g1ppra@smile.fi.intel.com \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=csokas.bence@prolan.hu \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=samuel@sholland.org \
    --cc=sebastian.reichel@collabora.com \
    --cc=wsa+renesas@sang-engineering.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