Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp2908801iog; Mon, 27 Jun 2022 05:33:34 -0700 (PDT) X-Google-Smtp-Source: AGRyM1ufcHbcQzag3tLkx+1tgAUOPmfBy8WORktcgMM+oLvhTtNWwaCxNHv/dVTuo6kg9IDSjMLr X-Received: by 2002:a17:90b:3b47:b0:1ee:d48b:26d9 with SMTP id ot7-20020a17090b3b4700b001eed48b26d9mr7460232pjb.129.1656333213879; Mon, 27 Jun 2022 05:33:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656333213; cv=none; d=google.com; s=arc-20160816; b=LhWnAjGlzdhloL1+LR9S4O/aAqBxTgjG506C4I766I7u5iOioghyDf8TqYDwTROY+8 Iuq9RL5bRd0mSq+IeoCLl2bbdzLm1mjEbarWgaKtGbeMw5y+IEaLpZIUrk0rRW3CtfdO PzMN0IXBqY3xv9h4DZ+G/jGVsW3bLlp/dlAyGWwWnT0+NiBuKaRwzHctsNy0zylChsY2 voSzgBK5UR+WcNbzphTEXFZhmYPXIGcLIXgkE2uRqyogCWjiPimD63WSNdCtw4CjzVsW YIF+Fk+XxOvistrdYp4vAU+fqgP3bBIn4lruuT2i2PuQzAUa3TuW0cwmrvhOmbhpwb0h Y4NA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=oG/NtpeZQb+4MTZTGOiYoH5Z4990yOeSnW6bXaF/Pws=; b=CPO8Hrqo3DWesR1Xb+JV3OnBZTWfzwRXNHL6zSrPhYvE76n380cbNc54Ho2QKHKYDh 1umL6nwXsN/wFvQ1wBFXQs6ybNykQ864Vmr+QGyeRsH4625/BmsqhYdknPIaEaFkbUDe L38rZzgXYOqBf5mONxDQkNBF3NcFBVOIU6F/dibhVZbXf4NC5z3ymMbjD4N+mGx//LyS AnvvdxVqBWflKwvLG2ADcTsJwcqTCN9dhdzTMOAKq8YVH/5t6HmVldFUrHY//ben4Hy7 sUy2A+YK4IBkak2CNWwE7enOefQ8uq6g3siZtO1Vni3l272KwAjxFRAZO+j1EC3UIuCB Np8g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=fQZ6bA8+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b28-20020a631b1c000000b003db2ab7cae4si14142234pgb.688.2022.06.27.05.33.20; Mon, 27 Jun 2022 05:33:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=fQZ6bA8+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235575AbiF0Ld5 (ORCPT + 99 others); Mon, 27 Jun 2022 07:33:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55636 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235639AbiF0Lc3 (ORCPT ); Mon, 27 Jun 2022 07:32:29 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5B8B365D3; Mon, 27 Jun 2022 04:29:27 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id E4DB3B81117; Mon, 27 Jun 2022 11:29:25 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 57F86C385A5; Mon, 27 Jun 2022 11:29:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1656329364; bh=Hv5XT+wihpAxWcKTmxWkBoWJWkQXIxwXbE/EI2bjpSU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fQZ6bA8+vS9zdjrgcs2sKay22J21sXs/ZTpz17teP72wpuyzSwHPFlXEz8SRAAgu8 ZEQEMgM9JyAj5Gxh7JMivX0l3J61LGxKTppu6ITdXtNUvE6rrXvVMNMnaOmY4Qm5ig 2oMxWEqCdfKto2MuvNA33t7L/me8jUsyBadHcrOw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dan Carpenter , Andy Shevchenko , Bartosz Golaszewski , Sasha Levin Subject: [PATCH 5.4 33/60] gpio: winbond: Fix error code in winbond_gpio_get() Date: Mon, 27 Jun 2022 13:21:44 +0200 Message-Id: <20220627111928.663134075@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220627111927.641837068@linuxfoundation.org> References: <20220627111927.641837068@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Dan Carpenter [ Upstream commit 9ca766eaea2e87b8b773bff04ee56c055cb76d4e ] This error path returns 1, but it should instead propagate the negative error code from winbond_sio_enter(). Fixes: a0d65009411c ("gpio: winbond: Add driver") Signed-off-by: Dan Carpenter Reviewed-by: Andy Shevchenko Signed-off-by: Bartosz Golaszewski Signed-off-by: Sasha Levin --- drivers/gpio/gpio-winbond.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/gpio/gpio-winbond.c b/drivers/gpio/gpio-winbond.c index 7f8f5b02e31d..4b61d975cc0e 100644 --- a/drivers/gpio/gpio-winbond.c +++ b/drivers/gpio/gpio-winbond.c @@ -385,12 +385,13 @@ static int winbond_gpio_get(struct gpio_chip *gc, unsigned int offset) unsigned long *base = gpiochip_get_data(gc); const struct winbond_gpio_info *info; bool val; + int ret; winbond_gpio_get_info(&offset, &info); - val = winbond_sio_enter(*base); - if (val) - return val; + ret = winbond_sio_enter(*base); + if (ret) + return ret; winbond_sio_select_logical(*base, info->dev); -- 2.35.1