From patchwork Mon Sep 21 13:10:57 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: 'Qinglang Miao X-Patchwork-Id: 254351 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 22C79C43464 for ; Mon, 21 Sep 2020 13:12:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id EEF262145D for ; Mon, 21 Sep 2020 13:12:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727633AbgIUNL5 (ORCPT ); Mon, 21 Sep 2020 09:11:57 -0400 Received: from szxga07-in.huawei.com ([45.249.212.35]:59860 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727418AbgIUNKo (ORCPT ); Mon, 21 Sep 2020 09:10:44 -0400 Received: from DGGEMS413-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 619AF2FDFB859F15DE85; Mon, 21 Sep 2020 21:10:42 +0800 (CST) Received: from localhost.localdomain.localdomain (10.175.113.25) by DGGEMS413-HUB.china.huawei.com (10.3.19.213) with Microsoft SMTP Server id 14.3.487.0; Mon, 21 Sep 2020 21:10:33 +0800 From: Qinglang Miao To: Linus Walleij CC: , , "Qinglang Miao" Subject: [PATCH -next] pinctrl: ocelot: simplify the return expression of ocelot_gpiochip_register() Date: Mon, 21 Sep 2020 21:10:57 +0800 Message-ID: <20200921131057.92895-1-miaoqinglang@huawei.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-Originating-IP: [10.175.113.25] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org Simplify the return expression. Signed-off-by: Qinglang Miao --- 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[] = {