mfd: bd9571mwv: Use devm_mfd_add_devices()
authorYoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Tue, 12 Jan 2021 09:00:56 +0000 (18:00 +0900)
committerLee Jones <lee.jones@linaro.org>
Thu, 14 Jan 2021 13:05:54 +0000 (13:05 +0000)
To remove mfd devices when unload this driver, should use
devm_mfd_add_devices() instead.

Fixes: d3ea21272094 ("mfd: Add ROHM BD9571MWV-M MFD PMIC driver")
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>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
drivers/mfd/bd9571mwv.c

index fab3cdc27ed64539b7089da302f41b037dad3b1e..19d57a45134c6bd2bfc47deb193f4a3f1df78eaf 100644 (file)
@@ -185,9 +185,9 @@ static int bd9571mwv_probe(struct i2c_client *client,
                return ret;
        }
 
-       ret = mfd_add_devices(bd->dev, PLATFORM_DEVID_AUTO, bd9571mwv_cells,
-                             ARRAY_SIZE(bd9571mwv_cells), NULL, 0,
-                             regmap_irq_get_domain(bd->irq_data));
+       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;