diff mbox series

[-next] pinctrl: ocelot: simplify the return expression of ocelot_gpiochip_register()

Message ID 20200921131057.92895-1-miaoqinglang@huawei.com
State Accepted
Commit 17f2c8d36f8c37d230bda4d2e6e9a903f57dcd19
Headers show
Series [-next] pinctrl: ocelot: simplify the return expression of ocelot_gpiochip_register() | expand

Commit Message

'Qinglang Miao Sept. 21, 2020, 1:10 p.m. UTC
Simplify the return expression.

Signed-off-by: Qinglang Miao <miaoqinglang@huawei.com>
---
 drivers/pinctrl/pinctrl-ocelot.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

Comments

Linus Walleij Sept. 29, 2020, 1:29 p.m. UTC | #1
On Mon, Sep 21, 2020 at 3:10 PM Qinglang Miao <miaoqinglang@huawei.com> wrote:

> Simplify the return expression.

>

> Signed-off-by: Qinglang Miao <miaoqinglang@huawei.com>


Patch applied.

Yours,
Linus Walleij
diff mbox series

Patch

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[] = {