linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Vaittinen, Matti" <Matti.Vaittinen@fi.rohmeurope.com>
To: "lgirdwood@gmail.com" <lgirdwood@gmail.com>,
	"marek.vasut+renesas@gmail.com" <marek.vasut+renesas@gmail.com>,
	"yoshihiro.shimoda.uh@renesas.com"
	<yoshihiro.shimoda.uh@renesas.com>,
	"broonie@kernel.org" <broonie@kernel.org>,
	"bgolaszewski@baylibre.com" <bgolaszewski@baylibre.com>,
	"lee.jones@linaro.org" <lee.jones@linaro.org>,
	"linus.walleij@linaro.org" <linus.walleij@linaro.org>
Cc: linux-power <linux-power@fi.rohmeurope.com>,
	"linux-gpio@vger.kernel.org" <linux-gpio@vger.kernel.org>,
	"khiem.nguyen.xt@renesas.com" <khiem.nguyen.xt@renesas.com>,
	"linux-renesas-soc@vger.kernel.org" 
	<linux-renesas-soc@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v3 10/12] mfd: bd9571mwv: Use devm_regmap_add_irq_chip()
Date: Wed, 16 Dec 2020 08:13:20 +0000	[thread overview]
Message-ID: <be6e3fd4b93865f285ed5470779e5c0f5eb37312.camel@fi.rohmeurope.com> (raw)
In-Reply-To: <1608104275-13174-11-git-send-email-yoshihiro.shimoda.uh@renesas.com>


On Wed, 2020-12-16 at 16:37 +0900, Yoshihiro Shimoda wrote:
> Use dev_regmap_add_irq_chip() to simplify the code.
> 
> Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Reviewed-by: Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com>

> ---
>  drivers/mfd/bd9571mwv.c | 27 ++++++---------------------
>  1 file changed, 6 insertions(+), 21 deletions(-)
> 
> diff --git a/drivers/mfd/bd9571mwv.c b/drivers/mfd/bd9571mwv.c
> index e68c3fa..49e968e 100644
> --- a/drivers/mfd/bd9571mwv.c
> +++ b/drivers/mfd/bd9571mwv.c
> @@ -170,31 +170,17 @@ static int bd9571mwv_probe(struct i2c_client
> *client,
>  	if (ret)
>  		return ret;
>  
> -	ret = regmap_add_irq_chip(bd->regmap, bd->irq, IRQF_ONESHOT, 0,
> -				  &bd9571mwv_irq_chip, &bd->irq_data);
> +	ret = devm_regmap_add_irq_chip(bd->dev, bd->regmap, bd->irq,
> +				       IRQF_ONESHOT, 0,
> &bd9571mwv_irq_chip,
> +				       &bd->irq_data);
>  	if (ret) {
>  		dev_err(bd->dev, "Failed to register IRQ chip\n");
>  		return ret;
>  	}
>  
> -	ret = devm_mfd_add_devices(bd->dev, PLATFORM_DEVID_AUTO,
> -				   bd9571mwv_cells,
> ARRAY_SIZE(bd9571mwv_cells),
> -				   NULL, 0, regmap_irq_get_domain(bd-
> >irq_data));

The funny diff formatting got me fooled. I spent a while wondering why
you do remove the devm_mfd_add_devices - untill I noticed that it was
just the diff playing tricks - it is added back in the remove. I should
practice my diff reading skills :) But the result looks good and clean
to me!

> -	if (ret) {
> -		regmap_del_irq_chip(bd->irq, bd->irq_data);
> -		return ret;
> -	}
> -
> -	return 0;
> -}
> -
> -static int bd9571mwv_remove(struct i2c_client *client)
> -{
> -	struct bd9571mwv *bd = i2c_get_clientdata(client);
> -
> -	regmap_del_irq_chip(bd->irq, bd->irq_data);
> -
> -	return 0;
> +	return devm_mfd_add_devices(bd->dev, PLATFORM_DEVID_AUTO,
> +				    bd9571mwv_cells,
> ARRAY_SIZE(bd9571mwv_cells),
> +				    NULL, 0, regmap_irq_get_domain(bd-
> >irq_data));
>  }
>  
>  static const struct of_device_id bd9571mwv_of_match_table[] = {
> @@ -215,7 +201,6 @@ static struct i2c_driver bd9571mwv_driver = {
>  		.of_match_table = bd9571mwv_of_match_table,
>  	},
>  	.probe		= bd9571mwv_probe,
> -	.remove		= bd9571mwv_remove,
>  	.id_table       = bd9571mwv_id_table,
>  };
>  module_i2c_driver(bd9571mwv_driver);


  reply	other threads:[~2020-12-16  8:14 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-16  7:37 [PATCH v3 00/12] treewide: bd9571mwv: Add support for BD9574MWF Yoshihiro Shimoda
2020-12-16  7:37 ` [PATCH v3 01/12] mfd: bd9571mwv: Use devm_mfd_add_devices() Yoshihiro Shimoda
2020-12-16 15:08   ` Lee Jones
2020-12-16  7:37 ` [PATCH v3 02/12] dt-bindings: mfd: bd9571mwv: Document BD9574MWF Yoshihiro Shimoda
2020-12-16  7:37 ` [PATCH v3 03/12] mfd: rohm-generic: Add BD9571 and BD9574 Yoshihiro Shimoda
2020-12-16 15:09   ` Lee Jones
2020-12-16  7:37 ` [PATCH v3 04/12] regulator: bd9571mwv: rid of using struct bd9571mwv Yoshihiro Shimoda
2020-12-16  7:37 ` [PATCH v3 05/12] regulator: bd9571mwv: Add BD9574MWF support Yoshihiro Shimoda
2020-12-16  7:37 ` [PATCH v3 06/12] gpio: bd9571mwv: Use the SPDX license identifier Yoshihiro Shimoda
2020-12-16  7:37 ` [PATCH v3 07/12] gpio: bd9571mwv: rid of using struct bd9571mwv Yoshihiro Shimoda
2020-12-16  7:37 ` [PATCH v3 08/12] gpio: bd9571mwv: Add BD9574MWF support Yoshihiro Shimoda
2020-12-16  7:37 ` [PATCH v3 09/12] mfd: bd9571mwv: Use the SPDX license identifier Yoshihiro Shimoda
2020-12-16 15:10   ` Lee Jones
2020-12-16  7:37 ` [PATCH v3 10/12] mfd: bd9571mwv: Use devm_regmap_add_irq_chip() Yoshihiro Shimoda
2020-12-16  8:13   ` Vaittinen, Matti [this message]
2020-12-16 15:12   ` Lee Jones
2020-12-16  7:37 ` [PATCH v3 11/12] mfd: bd9571mwv: Make the driver more generic Yoshihiro Shimoda
2020-12-16  8:25   ` Vaittinen, Matti
2020-12-16  8:45     ` Vaittinen, Matti
2020-12-16  9:00     ` Lee Jones
2020-12-16  9:09       ` Vaittinen, Matti
2020-12-16 15:35   ` Lee Jones
2020-12-17 11:44     ` Yoshihiro Shimoda
2020-12-16  7:37 ` [PATCH v3 12/12] mfd: bd9571mwv: Add support for BD9574MWF Yoshihiro Shimoda
2020-12-16  8:45   ` Vaittinen, Matti
2020-12-16  9:02     ` Lee Jones
2020-12-16  9:29       ` Vaittinen, Matti
2020-12-16 15:37   ` Lee Jones
2020-12-17 11:44     ` Yoshihiro Shimoda

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=be6e3fd4b93865f285ed5470779e5c0f5eb37312.camel@fi.rohmeurope.com \
    --to=matti.vaittinen@fi.rohmeurope.com \
    --cc=bgolaszewski@baylibre.com \
    --cc=broonie@kernel.org \
    --cc=khiem.nguyen.xt@renesas.com \
    --cc=lee.jones@linaro.org \
    --cc=lgirdwood@gmail.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-power@fi.rohmeurope.com \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=marek.vasut+renesas@gmail.com \
    --cc=yoshihiro.shimoda.uh@renesas.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;
as well as URLs for NNTP newsgroup(s).