aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mfd
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mfd')
-rw-r--r--drivers/mfd/asic3.c3
-rw-r--r--drivers/mfd/htc-i2cpld.c8
-rw-r--r--drivers/mfd/sm501.c17
-rw-r--r--drivers/mfd/tc6393xb.c13
-rw-r--r--drivers/mfd/ucb1x00-core.c8
5 files changed, 12 insertions, 37 deletions
diff --git a/drivers/mfd/asic3.c b/drivers/mfd/asic3.c
index 9fc4186d4132..977bd3a3eed0 100644
--- a/drivers/mfd/asic3.c
+++ b/drivers/mfd/asic3.c
@@ -605,7 +605,8 @@ static int asic3_gpio_remove(struct platform_device *pdev)
605{ 605{
606 struct asic3 *asic = platform_get_drvdata(pdev); 606 struct asic3 *asic = platform_get_drvdata(pdev);
607 607
608 return gpiochip_remove(&asic->gpio); 608 gpiochip_remove(&asic->gpio);
609 return 0;
609} 610}
610 611
611static void asic3_clk_enable(struct asic3 *asic, struct asic3_clk *clk) 612static void asic3_clk_enable(struct asic3 *asic, struct asic3_clk *clk)
diff --git a/drivers/mfd/htc-i2cpld.c b/drivers/mfd/htc-i2cpld.c
index b44f0203983b..eab3fb028447 100644
--- a/drivers/mfd/htc-i2cpld.c
+++ b/drivers/mfd/htc-i2cpld.c
@@ -481,15 +481,9 @@ static int htcpld_register_chip_gpio(
481 481
482 ret = gpiochip_add(&(chip->chip_in)); 482 ret = gpiochip_add(&(chip->chip_in));
483 if (ret) { 483 if (ret) {
484 int error;
485
486 dev_warn(dev, "Unable to register input GPIOs for 0x%x: %d\n", 484 dev_warn(dev, "Unable to register input GPIOs for 0x%x: %d\n",
487 plat_chip_data->addr, ret); 485 plat_chip_data->addr, ret);
488 486 gpiochip_remove(&(chip->chip_out));
489 error = gpiochip_remove(&(chip->chip_out));
490 if (error)
491 dev_warn(dev, "Error while trying to unregister gpio chip: %d\n", error);
492
493 return ret; 487 return ret;
494 } 488 }
495 489
diff --git a/drivers/mfd/sm501.c b/drivers/mfd/sm501.c
index 81e6d0932bf0..02027b7f1223 100644
--- a/drivers/mfd/sm501.c
+++ b/drivers/mfd/sm501.c
@@ -1047,7 +1047,6 @@ static int sm501_register_gpio(struct sm501_devdata *sm)
1047 struct sm501_gpio *gpio = &sm->gpio; 1047 struct sm501_gpio *gpio = &sm->gpio;
1048 resource_size_t iobase = sm->io_res->start + SM501_GPIO; 1048 resource_size_t iobase = sm->io_res->start + SM501_GPIO;
1049 int ret; 1049 int ret;
1050 int tmp;
1051 1050
1052 dev_dbg(sm->dev, "registering gpio block %08llx\n", 1051 dev_dbg(sm->dev, "registering gpio block %08llx\n",
1053 (unsigned long long)iobase); 1052 (unsigned long long)iobase);
@@ -1086,11 +1085,7 @@ static int sm501_register_gpio(struct sm501_devdata *sm)
1086 return 0; 1085 return 0;
1087 1086
1088 err_low_chip: 1087 err_low_chip:
1089 tmp = gpiochip_remove(&gpio->low.gpio); 1088 gpiochip_remove(&gpio->low.gpio);
1090 if (tmp) {
1091 dev_err(sm->dev, "cannot remove low chip, cannot tidy up\n");
1092 return ret;
1093 }
1094 1089
1095 err_mapped: 1090 err_mapped:
1096 iounmap(gpio->regs); 1091 iounmap(gpio->regs);
@@ -1105,18 +1100,12 @@ static int sm501_register_gpio(struct sm501_devdata *sm)
1105static void sm501_gpio_remove(struct sm501_devdata *sm) 1100static void sm501_gpio_remove(struct sm501_devdata *sm)
1106{ 1101{
1107 struct sm501_gpio *gpio = &sm->gpio; 1102 struct sm501_gpio *gpio = &sm->gpio;
1108 int ret;
1109 1103
1110 if (!sm->gpio.registered) 1104 if (!sm->gpio.registered)
1111 return; 1105 return;
1112 1106
1113 ret = gpiochip_remove(&gpio->low.gpio); 1107 gpiochip_remove(&gpio->low.gpio);
1114 if (ret) 1108 gpiochip_remove(&gpio->high.gpio);
1115 dev_err(sm->dev, "cannot remove low chip, cannot tidy up\n");
1116
1117 ret = gpiochip_remove(&gpio->high.gpio);
1118 if (ret)
1119 dev_err(sm->dev, "cannot remove high chip, cannot tidy up\n");
1120 1109
1121 iounmap(gpio->regs); 1110 iounmap(gpio->regs);
1122 release_resource(gpio->regs_res); 1111 release_resource(gpio->regs_res);
diff --git a/drivers/mfd/tc6393xb.c b/drivers/mfd/tc6393xb.c
index 11c19e538551..4fac16bcd732 100644
--- a/drivers/mfd/tc6393xb.c
+++ b/drivers/mfd/tc6393xb.c
@@ -607,7 +607,7 @@ static int tc6393xb_probe(struct platform_device *dev)
607 struct tc6393xb_platform_data *tcpd = dev_get_platdata(&dev->dev); 607 struct tc6393xb_platform_data *tcpd = dev_get_platdata(&dev->dev);
608 struct tc6393xb *tc6393xb; 608 struct tc6393xb *tc6393xb;
609 struct resource *iomem, *rscr; 609 struct resource *iomem, *rscr;
610 int ret, temp; 610 int ret;
611 611
612 iomem = platform_get_resource(dev, IORESOURCE_MEM, 0); 612 iomem = platform_get_resource(dev, IORESOURCE_MEM, 0);
613 if (!iomem) 613 if (!iomem)
@@ -714,7 +714,7 @@ err_setup:
714 714
715err_gpio_add: 715err_gpio_add:
716 if (tc6393xb->gpio.base != -1) 716 if (tc6393xb->gpio.base != -1)
717 temp = gpiochip_remove(&tc6393xb->gpio); 717 gpiochip_remove(&tc6393xb->gpio);
718 tcpd->disable(dev); 718 tcpd->disable(dev);
719err_enable: 719err_enable:
720 clk_disable(tc6393xb->clk); 720 clk_disable(tc6393xb->clk);
@@ -744,13 +744,8 @@ static int tc6393xb_remove(struct platform_device *dev)
744 744
745 tc6393xb_detach_irq(dev); 745 tc6393xb_detach_irq(dev);
746 746
747 if (tc6393xb->gpio.base != -1) { 747 if (tc6393xb->gpio.base != -1)
748 ret = gpiochip_remove(&tc6393xb->gpio); 748 gpiochip_remove(&tc6393xb->gpio);
749 if (ret) {
750 dev_err(&dev->dev, "Can't remove gpio chip: %d\n", ret);
751 return ret;
752 }
753 }
754 749
755 ret = tcpd->disable(dev); 750 ret = tcpd->disable(dev);
756 clk_disable(tc6393xb->clk); 751 clk_disable(tc6393xb->clk);
diff --git a/drivers/mfd/ucb1x00-core.c b/drivers/mfd/ucb1x00-core.c
index 153d595afaac..58ea9fdd3a15 100644
--- a/drivers/mfd/ucb1x00-core.c
+++ b/drivers/mfd/ucb1x00-core.c
@@ -621,7 +621,6 @@ static void ucb1x00_remove(struct mcp *mcp)
621 struct ucb1x00_plat_data *pdata = mcp->attached_device.platform_data; 621 struct ucb1x00_plat_data *pdata = mcp->attached_device.platform_data;
622 struct ucb1x00 *ucb = mcp_get_drvdata(mcp); 622 struct ucb1x00 *ucb = mcp_get_drvdata(mcp);
623 struct list_head *l, *n; 623 struct list_head *l, *n;
624 int ret;
625 624
626 mutex_lock(&ucb1x00_mutex); 625 mutex_lock(&ucb1x00_mutex);
627 list_del(&ucb->node); 626 list_del(&ucb->node);
@@ -631,11 +630,8 @@ static void ucb1x00_remove(struct mcp *mcp)
631 } 630 }
632 mutex_unlock(&ucb1x00_mutex); 631 mutex_unlock(&ucb1x00_mutex);
633 632
634 if (ucb->gpio.base != -1) { 633 if (ucb->gpio.base != -1)
635 ret = gpiochip_remove(&ucb->gpio); 634 gpiochip_remove(&ucb->gpio);
636 if (ret)
637 dev_err(&ucb->dev, "Can't remove gpio chip: %d\n", ret);
638 }
639 635
640 irq_set_chained_handler(ucb->irq, NULL); 636 irq_set_chained_handler(ucb->irq, NULL);
641 irq_free_descs(ucb->irq_base, 16); 637 irq_free_descs(ucb->irq_base, 16);