diff mbox

[V2,11/20] mfd: rdc321x: Use devm_mfd_add_devices() for mfd_device registration

Message ID 1460054594-32325-12-git-send-email-ldewangan@nvidia.com (mailing list archive)
State New, archived
Headers show

Commit Message

Laxman Dewangan April 7, 2016, 6:43 p.m. UTC
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.

Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
CC: Florian Fainelli <florian@openwrt.org>

---
Changes from V1:
- Convert mfd to MFD.
- Fix checkpatch --strict error on patch.

 drivers/mfd/rdc321x-southbridge.c | 13 ++++---------
 1 file changed, 4 insertions(+), 9 deletions(-)

Comments

Lee Jones April 11, 2016, 9:31 a.m. UTC | #1
Applied, thanks.

On Fri, 08 Apr 2016, Laxman Dewangan wrote:

> 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.
> 
> Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
> CC: Florian Fainelli <florian@openwrt.org>
> 
> ---
> Changes from V1:
> - Convert mfd to MFD.
> - Fix checkpatch --strict error on patch.
> 
>  drivers/mfd/rdc321x-southbridge.c | 13 ++++---------
>  1 file changed, 4 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/mfd/rdc321x-southbridge.c b/drivers/mfd/rdc321x-southbridge.c
> index 6575585..2bd8c5b 100644
> --- a/drivers/mfd/rdc321x-southbridge.c
> +++ b/drivers/mfd/rdc321x-southbridge.c
> @@ -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);
diff mbox

Patch

diff --git a/drivers/mfd/rdc321x-southbridge.c b/drivers/mfd/rdc321x-southbridge.c
index 6575585..2bd8c5b 100644
--- a/drivers/mfd/rdc321x-southbridge.c
+++ b/drivers/mfd/rdc321x-southbridge.c
@@ -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);