mfd: rdc321x: Use devm_mfd_add_devices() for mfd_device registration
authorLaxman Dewangan <ldewangan@nvidia.com>
Thu, 7 Apr 2016 18:43:05 +0000 (00:13 +0530)
committerLee Jones <lee.jones@linaro.org>
Tue, 19 Apr 2016 06:55:52 +0000 (07:55 +0100)
Use devm_mfd_add_devices() for MFD devices registration and get
rid of .remove callback to remove MFD child-devices. This is done
by managed device framework.

CC: Florian Fainelli <florian@openwrt.org>
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
drivers/mfd/rdc321x-southbridge.c

index 6575585f1d1f0eed3933383d1432cbaa40ba8dbe..2bd8c5b6d600a7824b8c9f437fb75b21f0f01b2e 100644 (file)
@@ -85,14 +85,10 @@ static int rdc321x_sb_probe(struct pci_dev *pdev,
        rdc321x_gpio_pdata.sb_pdev = pdev;
        rdc321x_wdt_pdata.sb_pdev = pdev;
 
-       return mfd_add_devices(&pdev->dev, -1,
-                              rdc321x_sb_cells, ARRAY_SIZE(rdc321x_sb_cells),
-                              NULL, 0, NULL);
-}
-
-static void rdc321x_sb_remove(struct pci_dev *pdev)
-{
-       mfd_remove_devices(&pdev->dev);
+       return devm_mfd_add_devices(&pdev->dev, -1,
+                                   rdc321x_sb_cells,
+                                   ARRAY_SIZE(rdc321x_sb_cells),
+                                   NULL, 0, NULL);
 }
 
 static const struct pci_device_id rdc321x_sb_table[] = {
@@ -105,7 +101,6 @@ static struct pci_driver rdc321x_sb_driver = {
        .name           = "RDC321x Southbridge",
        .id_table       = rdc321x_sb_table,
        .probe          = rdc321x_sb_probe,
-       .remove         = rdc321x_sb_remove,
 };
 
 module_pci_driver(rdc321x_sb_driver);