The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Heikki Krogerus <heikki.krogerus@linux.intel.com>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Subject: Re: [PATCH v2 1/1] usb: typec: stusb160x: Make use of i2c_get_match_data()
Date: Thu, 26 Sep 2024 17:56:51 +0300	[thread overview]
Message-ID: <ZvV2M7GBiInRO2PK@kuha.fi.intel.com> (raw)
In-Reply-To: <20240926122944.1251923-1-andriy.shevchenko@linux.intel.com>

On Thu, Sep 26, 2024 at 03:29:15PM +0300, Andy Shevchenko wrote:
> Get matching data in one step by switching to use i2c_get_match_data().
> As a positive side effect the matching data is qualified as a constant.
> 
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>

> ---
> v2: fixed rebase issue which led to the compilation error (LKP)
>  drivers/usb/typec/stusb160x.c | 7 +++----
>  1 file changed, 3 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/usb/typec/stusb160x.c b/drivers/usb/typec/stusb160x.c
> index f3140fc04c12..6d85b25b40bc 100644
> --- a/drivers/usb/typec/stusb160x.c
> +++ b/drivers/usb/typec/stusb160x.c
> @@ -633,9 +633,8 @@ MODULE_DEVICE_TABLE(of, stusb160x_of_match);
>  
>  static int stusb160x_probe(struct i2c_client *client)
>  {
> +	const struct regmap_config *regmap_config;
>  	struct stusb160x *chip;
> -	const struct of_device_id *match;
> -	struct regmap_config *regmap_config;
>  	struct fwnode_handle *fwnode;
>  	int ret;
>  
> @@ -645,8 +644,8 @@ static int stusb160x_probe(struct i2c_client *client)
>  
>  	i2c_set_clientdata(client, chip);
>  
> -	match = i2c_of_match_device(stusb160x_of_match, client);
> -	regmap_config = (struct regmap_config *)match->data;
> +	regmap_config = i2c_get_match_data(client);
> +
>  	chip->regmap = devm_regmap_init_i2c(client, regmap_config);
>  	if (IS_ERR(chip->regmap)) {
>  		ret = PTR_ERR(chip->regmap);
> -- 
> 2.43.0.rc1.1336.g36b5255a03ac

-- 
heikki

      reply	other threads:[~2024-09-26 14:56 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-26 12:29 [PATCH v2 1/1] usb: typec: stusb160x: Make use of i2c_get_match_data() Andy Shevchenko
2024-09-26 14:56 ` Heikki Krogerus [this message]

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=ZvV2M7GBiInRO2PK@kuha.fi.intel.com \
    --to=heikki.krogerus@linux.intel.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@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