2020-12-21 02:56:08

by Yoshihiro Shimoda

[permalink] [raw]
Subject: [PATCH v4 10/12] mfd: bd9571mwv: Use devm_regmap_add_irq_chip()

Use dev_regmap_add_irq_chip() to simplify the code.

Signed-off-by: Yoshihiro Shimoda <[email protected]>
Acked-for-MFD-by: Lee Jones <[email protected]>
---
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));
- 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);
--
2.7.4


2020-12-22 08:53:11

by Geert Uytterhoeven

[permalink] [raw]
Subject: Re: [PATCH v4 10/12] mfd: bd9571mwv: Use devm_regmap_add_irq_chip()

On Mon, Dec 21, 2020 at 3:57 AM Yoshihiro Shimoda
<[email protected]> wrote:
> Use dev_regmap_add_irq_chip() to simplify the code.
>
> Signed-off-by: Yoshihiro Shimoda <[email protected]>
> Acked-for-MFD-by: Lee Jones <[email protected]>

Reviewed-by: Geert Uytterhoeven <[email protected]>

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds

2020-12-22 09:18:02

by Matti Vaittinen

[permalink] [raw]
Subject: Re: [PATCH v4 10/12] mfd: bd9571mwv: Use devm_regmap_add_irq_chip()


On Tue, 2020-12-22 at 09:49 +0100, Geert Uytterhoeven wrote:
> On Mon, Dec 21, 2020 at 3:57 AM Yoshihiro Shimoda
> <[email protected]> wrote:
> > Use dev_regmap_add_irq_chip() to simplify the code.
> >
> > Signed-off-by: Yoshihiro Shimoda <[email protected]>
> > Acked-for-MFD-by: Lee Jones <[email protected]>
>
> Reviewed-by: Geert Uytterhoeven <[email protected]>
Reviewed-by: Matti Vaittinen <[email protected]>

I thought I did review this earlier...

Br,
Matti Vaittinen

2020-12-22 09:27:48

by Yoshihiro Shimoda

[permalink] [raw]
Subject: RE: [PATCH v4 10/12] mfd: bd9571mwv: Use devm_regmap_add_irq_chip()

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
> > <[email protected]> wrote:
> > > Use dev_regmap_add_irq_chip() to simplify the code.
> > >
> > > Signed-off-by: Yoshihiro Shimoda <[email protected]>
> > > Acked-for-MFD-by: Lee Jones <[email protected]>
> >
> > Reviewed-by: Geert Uytterhoeven <[email protected]>
> Reviewed-by: Matti Vaittinen <[email protected]>

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

2020-12-22 09:41:19

by Matti Vaittinen

[permalink] [raw]
Subject: Re: [PATCH v4 10/12] mfd: bd9571mwv: Use devm_regmap_add_irq_chip()


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
> > > <[email protected]> wrote:
> > > > Use dev_regmap_add_irq_chip() to simplify the code.
> > > >
> > > > Signed-off-by: Yoshihiro Shimoda <
> > > > [email protected]>
> > > > Acked-for-MFD-by: Lee Jones <[email protected]>
> > >
> > > Reviewed-by: Geert Uytterhoeven <[email protected]>
> > Reviewed-by: Matti Vaittinen <[email protected]>
>
> 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
>

2020-12-22 11:19:12

by Yoshihiro Shimoda

[permalink] [raw]
Subject: RE: [PATCH v4 10/12] mfd: bd9571mwv: Use devm_regmap_add_irq_chip()

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
> > > > <[email protected]> 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