Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp2924798iog; Mon, 27 Jun 2022 05:54:22 -0700 (PDT) X-Google-Smtp-Source: AGRyM1ty00MpNNlOSCzchyESjhq+gSQnpfLua7ZKHsjY9ZkbCczFT336Kgb2xNOAhaEqypBSCDH2 X-Received: by 2002:a05:6a00:14c4:b0:525:9341:288 with SMTP id w4-20020a056a0014c400b0052593410288mr11727852pfu.1.1656334462454; Mon, 27 Jun 2022 05:54:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656334462; cv=none; d=google.com; s=arc-20160816; b=RPo+GaKBOL1mYPTLlo4iCtVlOx3wmT4psyTpZxMqTZOhnRdpdByHi31XDj3PStXXQz HlJxq5nGznRkkVwwqWWzQRzU0g4jHccpaVFlJlgzdQROSuNqGVZz60SL2B8NjfaEQ/qg 7NJpkX5QAseq05P0ulsEW2IDSGs9Um/FE8VYUA+c9MAZ6SmlluzzH/pWdADIVcbHyWUD Gnkvn86LzvDIBVu4o72aVZNo1BE6ZcH/Er+reur4Kd31Cka5zBF9Qe4hJi9Z1Cl6E1SY 61JCQq7ysT8ocPMGrpqRYUHCAtD1O5fc55/PbnedVDee8xY6Nqsb6x2gB9L31XulpXAf HogA== 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=n6a69uUnAhx3GsjtmscXX9LIHXQkRlCAR46mkjjjEFw7oayKLtE4G5bOXqye1gqiHC iyPo8O188t99iC+wbnmXF6px3K9CLHMoeCbkUyMxt+v9sG7gHvXSoRekWdONBM7E+iQn ZxcP+R1DtRTwGV9r/5htlyiwquvip4CGTqQpz/GDjlKFVDJ96pmgHi21XQlGeGi6oAd/ F8qIZrhvCEmezlrMSzuiDhg/TRdYc24EPzXs51wM7uEnxnpTyyub8ps6SAlBBvVuKhhv 2SnBENwiMBrk08ccw34APUrkPwclc7DE203aN3yr5gcCz7NJj1DLfJ2ViKqtg/ELOz76 SeEw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=UsDPX8ex; 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 m75-20020a633f4e000000b003ab7a1a2193si15268120pga.151.2022.06.27.05.54.08; Mon, 27 Jun 2022 05:54:22 -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=UsDPX8ex; 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 S239190AbiF0LzU (ORCPT + 99 others); Mon, 27 Jun 2022 07:55:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49982 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238568AbiF0Lsq (ORCPT ); Mon, 27 Jun 2022 07:48:46 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2DD93D40; Mon, 27 Jun 2022 04:42: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 C4CE0B80D32; Mon, 27 Jun 2022 11:42:25 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 25EDAC3411D; Mon, 27 Jun 2022 11:42:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1656330144; bh=Hv5XT+wihpAxWcKTmxWkBoWJWkQXIxwXbE/EI2bjpSU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UsDPX8exEloltrWU77i6086U//5sHLtx+gAkY2kp2g8YuY8P/INFh0qJPEaVjsRMX dQDaxASioMu+wSbdt2qYcFSeLmIMmDnfK8V2zQXi3B1FrUUJDRA7O8o3t4LU6UjASO 3Ia0QjUD98GOxg28p4lw0y7r9/xyNzVVC9vBgHOw= 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.18 100/181] gpio: winbond: Fix error code in winbond_gpio_get() Date: Mon, 27 Jun 2022 13:21:13 +0200 Message-Id: <20220627111947.597758438@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220627111944.553492442@linuxfoundation.org> References: <20220627111944.553492442@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