pinctrl: remove all usage of gpio_remove ret val in driver/pinctl

Signed-off-by: abdoulaye berthe <berthe.ab@gmail.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
This commit is contained in:
abdoulaye berthe 2014-07-12 22:30:13 +02:00 коммит произвёл Linus Walleij
Родитель 144ef62645
Коммит b4e7c55dab
9 изменённых файлов: 20 добавлений и 55 удалений

Просмотреть файл

@ -949,7 +949,7 @@ static int adi_gpio_probe(struct platform_device *pdev)
struct gpio_port *port; struct gpio_port *port;
char pinctrl_devname[DEVNAME_SIZE]; char pinctrl_devname[DEVNAME_SIZE];
static int gpio; static int gpio;
int ret = 0, ret1; int ret = 0;
pdata = dev->platform_data; pdata = dev->platform_data;
if (!pdata) if (!pdata)
@ -1027,7 +1027,7 @@ static int adi_gpio_probe(struct platform_device *pdev)
return 0; return 0;
out_remove_gpiochip: out_remove_gpiochip:
ret1 = gpiochip_remove(&port->chip); gpiochip_remove(&port->chip);
out_remove_domain: out_remove_domain:
if (port->pint) if (port->pint)
irq_domain_remove(port->domain); irq_domain_remove(port->domain);
@ -1038,12 +1038,11 @@ out_remove_domain:
static int adi_gpio_remove(struct platform_device *pdev) static int adi_gpio_remove(struct platform_device *pdev)
{ {
struct gpio_port *port = platform_get_drvdata(pdev); struct gpio_port *port = platform_get_drvdata(pdev);
int ret;
u8 offset; u8 offset;
list_del(&port->node); list_del(&port->node);
gpiochip_remove_pin_ranges(&port->chip); gpiochip_remove_pin_ranges(&port->chip);
ret = gpiochip_remove(&port->chip); gpiochip_remove(&port->chip);
if (port->pint) { if (port->pint) {
for (offset = 0; offset < port->width; offset++) for (offset = 0; offset < port->width; offset++)
irq_dispose_mapping(irq_find_mapping(port->domain, irq_dispose_mapping(irq_find_mapping(port->domain,
@ -1051,7 +1050,7 @@ static int adi_gpio_remove(struct platform_device *pdev)
irq_domain_remove(port->domain); irq_domain_remove(port->domain);
} }
return ret; return 0;
} }
static int adi_pinctrl_probe(struct platform_device *pdev) static int adi_pinctrl_probe(struct platform_device *pdev)

Просмотреть файл

@ -565,7 +565,6 @@ static int as3722_pinctrl_probe(struct platform_device *pdev)
{ {
struct as3722_pctrl_info *as_pci; struct as3722_pctrl_info *as_pci;
int ret; int ret;
int tret;
as_pci = devm_kzalloc(&pdev->dev, sizeof(*as_pci), GFP_KERNEL); as_pci = devm_kzalloc(&pdev->dev, sizeof(*as_pci), GFP_KERNEL);
if (!as_pci) if (!as_pci)
@ -611,10 +610,7 @@ static int as3722_pinctrl_probe(struct platform_device *pdev)
return 0; return 0;
fail_range_add: fail_range_add:
tret = gpiochip_remove(&as_pci->gpio_chip); gpiochip_remove(&as_pci->gpio_chip);
if (tret < 0)
dev_warn(&pdev->dev, "Couldn't remove gpio chip, %d\n", tret);
fail_chip_add: fail_chip_add:
pinctrl_unregister(as_pci->pctl); pinctrl_unregister(as_pci->pctl);
return ret; return ret;
@ -623,11 +619,8 @@ fail_chip_add:
static int as3722_pinctrl_remove(struct platform_device *pdev) static int as3722_pinctrl_remove(struct platform_device *pdev)
{ {
struct as3722_pctrl_info *as_pci = platform_get_drvdata(pdev); struct as3722_pctrl_info *as_pci = platform_get_drvdata(pdev);
int ret;
ret = gpiochip_remove(&as_pci->gpio_chip); gpiochip_remove(&as_pci->gpio_chip);
if (ret < 0)
return ret;
pinctrl_unregister(as_pci->pctl); pinctrl_unregister(as_pci->pctl);
return 0; return 0;
} }

Просмотреть файл

@ -638,12 +638,9 @@ MODULE_DEVICE_TABLE(acpi, byt_gpio_acpi_match);
static int byt_gpio_remove(struct platform_device *pdev) static int byt_gpio_remove(struct platform_device *pdev)
{ {
struct byt_gpio *vg = platform_get_drvdata(pdev); struct byt_gpio *vg = platform_get_drvdata(pdev);
int err;
pm_runtime_disable(&pdev->dev); pm_runtime_disable(&pdev->dev);
err = gpiochip_remove(&vg->chip); gpiochip_remove(&vg->chip);
if (err)
dev_warn(&pdev->dev, "failed to remove gpio_chip.\n");
return 0; return 0;
} }

Просмотреть файл

@ -756,8 +756,7 @@ static int __init u300_gpio_probe(struct platform_device *pdev)
err_no_range: err_no_range:
err_no_irqchip: err_no_irqchip:
if (gpiochip_remove(&gpio->chip)) gpiochip_remove(&gpio->chip);
dev_err(&pdev->dev, "failed to remove gpio chip\n");
err_no_chip: err_no_chip:
clk_disable_unprepare(gpio->clk); clk_disable_unprepare(gpio->clk);
dev_err(&pdev->dev, "module ERROR:%d\n", err); dev_err(&pdev->dev, "module ERROR:%d\n", err);
@ -767,16 +766,11 @@ err_no_chip:
static int __exit u300_gpio_remove(struct platform_device *pdev) static int __exit u300_gpio_remove(struct platform_device *pdev)
{ {
struct u300_gpio *gpio = platform_get_drvdata(pdev); struct u300_gpio *gpio = platform_get_drvdata(pdev);
int err;
/* Turn off the GPIO block */ /* Turn off the GPIO block */
writel(0x00000000U, gpio->base + U300_GPIO_CR); writel(0x00000000U, gpio->base + U300_GPIO_CR);
err = gpiochip_remove(&gpio->chip); gpiochip_remove(&gpio->chip);
if (err < 0) {
dev_err(gpio->dev, "unable to remove gpiochip: %d\n", err);
return err;
}
clk_disable_unprepare(gpio->clk); clk_disable_unprepare(gpio->clk);
return 0; return 0;
} }

Просмотреть файл

@ -1492,10 +1492,7 @@ fail:
for (--i, --bank; i >= 0; --i, --bank) { for (--i, --bank; i >= 0; --i, --bank) {
if (!bank->valid) if (!bank->valid)
continue; continue;
gpiochip_remove(&bank->gpio_chip);
if (gpiochip_remove(&bank->gpio_chip))
dev_err(&pdev->dev, "gpio chip %s remove failed\n",
bank->gpio_chip.label);
} }
return ret; return ret;
} }
@ -1505,20 +1502,15 @@ static int rockchip_gpiolib_unregister(struct platform_device *pdev,
{ {
struct rockchip_pin_ctrl *ctrl = info->ctrl; struct rockchip_pin_ctrl *ctrl = info->ctrl;
struct rockchip_pin_bank *bank = ctrl->pin_banks; struct rockchip_pin_bank *bank = ctrl->pin_banks;
int ret = 0;
int i; int i;
for (i = 0; !ret && i < ctrl->nr_banks; ++i, ++bank) { for (i = 0; i < ctrl->nr_banks; ++i, ++bank) {
if (!bank->valid) if (!bank->valid)
continue; continue;
gpiochip_remove(&bank->gpio_chip);
ret = gpiochip_remove(&bank->gpio_chip);
} }
if (ret) return 0;
dev_err(&pdev->dev, "gpio chip remove failed\n");
return ret;
} }
static int rockchip_get_bank_data(struct rockchip_pin_bank *bank, static int rockchip_get_bank_data(struct rockchip_pin_bank *bank,

Просмотреть файл

@ -409,11 +409,8 @@ int sh_pfc_register_gpiochip(struct sh_pfc *pfc)
int sh_pfc_unregister_gpiochip(struct sh_pfc *pfc) int sh_pfc_unregister_gpiochip(struct sh_pfc *pfc)
{ {
int err; gpiochip_remove(&pfc->gpio->gpio_chip);
int ret; gpiochip_remove(&pfc->func->gpio_chip);
ret = gpiochip_remove(&pfc->gpio->gpio_chip); return 0;
err = gpiochip_remove(&pfc->func->gpio_chip);
return ret < 0 ? ret : err;
} }

Просмотреть файл

@ -606,8 +606,7 @@ static int plgpio_probe(struct platform_device *pdev)
remove_gpiochip: remove_gpiochip:
dev_info(&pdev->dev, "Remove gpiochip\n"); dev_info(&pdev->dev, "Remove gpiochip\n");
if (gpiochip_remove(&plgpio->chip)) gpiochip_remove(&plgpio->chip);
dev_err(&pdev->dev, "unable to remove gpiochip\n");
unprepare_clk: unprepare_clk:
if (!IS_ERR(plgpio->clk)) if (!IS_ERR(plgpio->clk))
clk_unprepare(plgpio->clk); clk_unprepare(plgpio->clk);

Просмотреть файл

@ -983,8 +983,7 @@ int sunxi_pinctrl_init(struct platform_device *pdev,
clk_error: clk_error:
clk_disable_unprepare(clk); clk_disable_unprepare(clk);
gpiochip_error: gpiochip_error:
if (gpiochip_remove(pctl->chip)) gpiochip_remove(pctl->chip);
dev_err(&pdev->dev, "failed to remove gpio chip\n");
pinctrl_error: pinctrl_error:
pinctrl_unregister(pctl->pctl_dev); pinctrl_unregister(pctl->pctl_dev);
return ret; return ret;

Просмотреть файл

@ -615,8 +615,7 @@ int wmt_pinctrl_probe(struct platform_device *pdev,
return 0; return 0;
fail_range: fail_range:
if (gpiochip_remove(&data->gpio_chip)) gpiochip_remove(&data->gpio_chip);
dev_err(&pdev->dev, "failed to remove gpio chip\n");
fail_gpio: fail_gpio:
pinctrl_unregister(data->pctl_dev); pinctrl_unregister(data->pctl_dev);
return err; return err;
@ -625,12 +624,8 @@ fail_gpio:
int wmt_pinctrl_remove(struct platform_device *pdev) int wmt_pinctrl_remove(struct platform_device *pdev)
{ {
struct wmt_pinctrl_data *data = platform_get_drvdata(pdev); struct wmt_pinctrl_data *data = platform_get_drvdata(pdev);
int err;
err = gpiochip_remove(&data->gpio_chip);
if (err)
dev_err(&pdev->dev, "failed to remove gpio chip\n");
gpiochip_remove(&data->gpio_chip);
pinctrl_unregister(data->pctl_dev); pinctrl_unregister(data->pctl_dev);
return 0; return 0;