[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200921131057.92895-1-miaoqinglang@huawei.com>
Date: Mon, 21 Sep 2020 21:10:57 +0800
From: Qinglang Miao <miaoqinglang@...wei.com>
To: Linus Walleij <linus.walleij@...aro.org>
CC: <linux-gpio@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
"Qinglang Miao" <miaoqinglang@...wei.com>
Subject: [PATCH -next] pinctrl: ocelot: simplify the return expression of ocelot_gpiochip_register()
Simplify the return expression.
Signed-off-by: Qinglang Miao <miaoqinglang@...wei.com>
---
drivers/pinctrl/pinctrl-ocelot.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/drivers/pinctrl/pinctrl-ocelot.c b/drivers/pinctrl/pinctrl-ocelot.c
index 425a3d764..a4a1b00f7 100644
--- a/drivers/pinctrl/pinctrl-ocelot.c
+++ b/drivers/pinctrl/pinctrl-ocelot.c
@@ -1120,7 +1120,7 @@ static int ocelot_gpiochip_register(struct platform_device *pdev,
{
struct gpio_chip *gc;
struct gpio_irq_chip *girq;
- int ret, irq;
+ int irq;
info->gpio_chip = ocelot_gpiolib_chip;
@@ -1147,11 +1147,7 @@ static int ocelot_gpiochip_register(struct platform_device *pdev,
girq->handler = handle_edge_irq;
}
- ret = devm_gpiochip_add_data(&pdev->dev, gc, info);
- if (ret)
- return ret;
-
- return 0;
+ return devm_gpiochip_add_data(&pdev->dev, gc, info);
}
static const struct of_device_id ocelot_pinctrl_of_match[] = {
--
2.23.0
Powered by blists - more mailing lists