bt8xxgpio: Check gpiochip_remove() result
Subsystems (2)
PATCH RESEND 1/1 bt8xxgpio: Check gpiochip_remove() result
Resending the patch, forgot about checkpatch.pl
Signed-off-by Javier Martinez Canillas <[email protected]>
--- drivers/gpio/bt8xxgpio.c | 33 +++++++++++++++++++-------------- 1 files changed, 19 insertions(+), 14 deletions(-)
drivers/gpio/bt8xxgpio.c +19 -14
@@ -242,20 +242,25 @@ err_freebg:static void bt8xxgpio_remove (struct pci_dev *pdev) {struct bt8xxgpio *bg =pci_get_drvdata (pdev); - -gpiochip_remove (&bg->gpio); - -bgwrite (0 ,BT848_INT_MASK ); -bgwrite (~0x0 ,BT848_INT_STAT ); -bgwrite (0x0 ,BT848_GPIO_OUT_EN ); - -iounmap (bg->mmio); -release_mem_region (pci_resource_start (pdev,0 ), -pci_resource_len (pdev,0 )); -pci_disable_device (pdev); - -pci_set_drvdata (pdev,NULL ); -kfree (bg); +int ret; + + ret =gpiochip_remove (&bg->gpio); + +if (!ret) { +bgwrite (0 ,BT848_INT_MASK ); +bgwrite (~0x0 ,BT848_INT_STAT ); +bgwrite (0x0 ,BT848_GPIO_OUT_EN ); + +iounmap (bg->mmio); +release_mem_region (pci_resource_start (pdev,0 ), +pci_resource_len (pdev,0 )); +pci_disable_device (pdev); + +pci_set_drvdata (pdev,NULL ); +kfree (bg); + } else + dev_err(&pdev->dev, "Failed to remove the GPIO controller: + %d\n", ret); } #ifdef CONFIG_PM
Signature · 1 line
1.6.0.4
PATCH RESEND 1/1 bt8xxgpio: Check gpiochip_remove() result
Forgot about checkpatch.pl, resending the patch. Sorry for the inconvenience.
Signed-off-by Javier Martinez Canillas <[email protected]>
--- drivers/gpio/bt8xxgpio.c | 33 +++++++++++++++++++-------------- 1 files changed, 19 insertions(+), 14 deletions(-)
drivers/gpio/bt8xxgpio.c +19 -14
@@ -242,20 +242,25 @@ err_freebg:static void bt8xxgpio_remove (struct pci_dev *pdev) {struct bt8xxgpio *bg =pci_get_drvdata (pdev); - -gpiochip_remove (&bg->gpio); - -bgwrite (0 ,BT848_INT_MASK ); -bgwrite (~0x0 ,BT848_INT_STAT ); -bgwrite (0x0 ,BT848_GPIO_OUT_EN ); - -iounmap (bg->mmio); -release_mem_region (pci_resource_start (pdev,0 ), -pci_resource_len (pdev,0 )); -pci_disable_device (pdev); - -pci_set_drvdata (pdev,NULL ); -kfree (bg); +int ret; + + ret =gpiochip_remove (&bg->gpio); + +if (!ret) { +bgwrite (0 ,BT848_INT_MASK ); +bgwrite (~0x0 ,BT848_INT_STAT ); +bgwrite (0x0 ,BT848_GPIO_OUT_EN ); + +iounmap (bg->mmio); +release_mem_region (pci_resource_start (pdev,0 ), +pci_resource_len (pdev,0 )); +pci_disable_device (pdev); + +pci_set_drvdata (pdev,NULL ); +kfree (bg); + }else +dev_err (&pdev->dev,"Failed to remove the GPIO controller: \ +%d\n" , ret); }#ifdef CONFIG_PM
Signature · 1 line
1.6.0.4