diff mbox series

[v4,10/12] mfd: bd9571mwv: Use devm_regmap_add_irq_chip()

Message ID 1608519279-13341-11-git-send-email-yoshihiro.shimoda.uh@renesas.com
State New
Headers show
Series treewide: bd9571mwv: Add support for BD9574MWF | expand

Commit Message

Yoshihiro Shimoda Dec. 21, 2020, 2:54 a.m. UTC
Use dev_regmap_add_irq_chip() to simplify the code.

Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Acked-for-MFD-by: Lee Jones <lee.jones@linaro.org>
---
 drivers/mfd/bd9571mwv.c | 27 ++++++---------------------
 1 file changed, 6 insertions(+), 21 deletions(-)

Comments

Geert Uytterhoeven Dec. 22, 2020, 8:49 a.m. UTC | #1
On Mon, Dec 21, 2020 at 3:57 AM Yoshihiro Shimoda
<yoshihiro.shimoda.uh@renesas.com> wrote:
> Use dev_regmap_add_irq_chip() to simplify the code.
>
> Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
> Acked-for-MFD-by: Lee Jones <lee.jones@linaro.org>

Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>

Gr{oetje,eeting}s,

                        Geert
Matti Vaittinen Dec. 22, 2020, 9:15 a.m. UTC | #2
On Tue, 2020-12-22 at 09:49 +0100, Geert Uytterhoeven wrote:
> On Mon, Dec 21, 2020 at 3:57 AM Yoshihiro Shimoda
> <yoshihiro.shimoda.uh@renesas.com> wrote:
> > Use dev_regmap_add_irq_chip() to simplify the code.
> > 
> > Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
> > Acked-for-MFD-by: Lee Jones <lee.jones@linaro.org>
> 
> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com>

I thought I did review this earlier...

Br,
    Matti Vaittinen
Yoshihiro Shimoda Dec. 22, 2020, 9:25 a.m. UTC | #3
Hi Matti-san,

> From: Vaittinen, Matti, Sent: Tuesday, December 22, 2020 6:15 PM
> 
> On Tue, 2020-12-22 at 09:49 +0100, Geert Uytterhoeven wrote:
> > On Mon, Dec 21, 2020 at 3:57 AM Yoshihiro Shimoda
> > <yoshihiro.shimoda.uh@renesas.com> wrote:
> > > Use dev_regmap_add_irq_chip() to simplify the code.
> > >
> > > Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
> > > Acked-for-MFD-by: Lee Jones <lee.jones@linaro.org>
> >
> > Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
> Reviewed-by: Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com>

Thank you for your review!

> I thought I did review this earlier...

You're correct. I'm sorry, I completely overlooked your Reviewed-by
tag in previous.

Best regards,
Yoshihiro Shimoda
Matti Vaittinen Dec. 22, 2020, 9:39 a.m. UTC | #4
On Tue, 2020-12-22 at 09:25 +0000, Yoshihiro Shimoda wrote:
> Hi Matti-san,
> 
> > From: Vaittinen, Matti, Sent: Tuesday, December 22, 2020 6:15 PM
> > 
> > On Tue, 2020-12-22 at 09:49 +0100, Geert Uytterhoeven wrote:
> > > On Mon, Dec 21, 2020 at 3:57 AM Yoshihiro Shimoda
> > > <yoshihiro.shimoda.uh@renesas.com> wrote:
> > > > Use dev_regmap_add_irq_chip() to simplify the code.
> > > > 
> > > > Signed-off-by: Yoshihiro Shimoda <
> > > > yoshihiro.shimoda.uh@renesas.com>
> > > > Acked-for-MFD-by: Lee Jones <lee.jones@linaro.org>
> > > 
> > > Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
> > Reviewed-by: Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com>
> 
> Thank you for your review!
> 
> > I thought I did review this earlier...
> 
> You're correct. I'm sorry, I completely overlooked your Reviewed-by
> tag in previous.

It happens :) But of you re-spin the series, please revise the tags for
patches. I think I did review almost all of them (except the SPDX-
patches as I am not competent on licenses...)

> 
> Best regards,
> Yoshihiro Shimoda
>
Yoshihiro Shimoda Dec. 22, 2020, 11:15 a.m. UTC | #5
Hi Matti-san,

> From: Vaittinen, Matti, Sent: Tuesday, December 22, 2020 6:39 PM
> 
> On Tue, 2020-12-22 at 09:25 +0000, Yoshihiro Shimoda wrote:
> > Hi Matti-san,
> >
> > > From: Vaittinen, Matti, Sent: Tuesday, December 22, 2020 6:15 PM
> > >
> > > On Tue, 2020-12-22 at 09:49 +0100, Geert Uytterhoeven wrote:
> > > > On Mon, Dec 21, 2020 at 3:57 AM Yoshihiro Shimoda
> > > > <yoshihiro.shimoda.uh@renesas.com> wrote:
<snip>
> > > I thought I did review this earlier...
> >
> > You're correct. I'm sorry, I completely overlooked your Reviewed-by
> > tag in previous.
> 
> It happens :) But of you re-spin the series, please revise the tags for
> patches. I think I did review almost all of them (except the SPDX-
> patches as I am not competent on licenses...)

I got it. I'll add your Reviewed-by tags.

Best regards,
Yoshihiro Shimoda
diff mbox series

Patch

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));
-	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);