Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp656674iog; Thu, 30 Jun 2022 07:49:08 -0700 (PDT) X-Google-Smtp-Source: AGRyM1v4cDF7en0ifk7QJWYkBjFrl8ZWYIXJKp6FoLx1BCSecWqk9zbYf33V70nSl/AT+lad2gl9 X-Received: by 2002:a17:906:106:b0:722:e997:a365 with SMTP id 6-20020a170906010600b00722e997a365mr9464794eje.169.1656600547971; Thu, 30 Jun 2022 07:49:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656600547; cv=none; d=google.com; s=arc-20160816; b=UT9WPUeYh9orfnW0ra83NhiI0Dx/mEDDLVlfckoXZ/ZQfytLEL+f5eRfMJxhrFjBPw Lya25GcBJuAwV0caHS0mHlbB4MuPUfDIwxzoWPJJTs7c2kN5A+fsgpA9eYhX6sMAGGF/ jmcRYMJ1upmJhx7xRVbQrktT7sd+m25oHSsWyV2kKukcoaI9oy9XU37Fu24Xs+JCMPCN N1d5+ps/JrjrM72nc33dsAiN5XnN14/le1THmFP4sL8ushZw2W1BHgoLnbk35udej42V M761YSBV4cXUqRZ44es1S5xlRuxez8TLcIfF7Kuj11wCrphgKLa1Lr4qGETwIHeOj+oK h4FQ== 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=qlmi6JlFnvmHgxR+5InS52FAnKgKQOnDKsB+gjVbAyag/xRBRKVMsfXay2XfIHkuim QZcxtb6EBOKHJYrEPmtGAPZG6I1/la+OvkxV//2SvL5ZEkSAtLG3PqGslBTDm5sESF2O tS6jg5EB0ld+Ge03U9s296ZT5aNSYEehGesg3wja43/umJ3T2H4hUSM3oWY0S2iBDupN B1ABx9sQGMq6iDfupa5LTZAt1+0dDUU6aeE7sI4vERoJ2GfI/MbUxz5TVt6vpd/NF/yo j2MpBE11muG9M+zYOMTj/2mEWTsaTQnTNJYv3zCJ49C3CON6Qa1NfkkQOqhNxpvL1ZUr IdLA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=xhn6jJFA; 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 sg10-20020a170907a40a00b0072a4b4fb1e0si5319287ejc.911.2022.06.30.07.48.42; Thu, 30 Jun 2022 07:49:07 -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=xhn6jJFA; 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 S236130AbiF3OAH (ORCPT + 99 others); Thu, 30 Jun 2022 10:00:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36514 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236415AbiF3N6m (ORCPT ); Thu, 30 Jun 2022 09:58:42 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C9AE94163B; Thu, 30 Jun 2022 06:51:43 -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 A2EBBB82AFA; Thu, 30 Jun 2022 13:51:19 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id F3347C34115; Thu, 30 Jun 2022 13:51:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1656597078; bh=Hv5XT+wihpAxWcKTmxWkBoWJWkQXIxwXbE/EI2bjpSU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=xhn6jJFAjAyJU1Tmh0ZTrIby0B5DlDF5klLeLKFQIgndg3J+pXG+uwfn+Awp1YDLG wNfchk+RxRq7xONqD2lmaGWIf+hKW/RFhe08H6SJeTExO0x9AIy7zVOJctHqls/hBE WkT5peYzPvaCHHARmdCrWQlRqVRy3Yf+sPrcGphQ= 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 4.19 20/49] gpio: winbond: Fix error code in winbond_gpio_get() Date: Thu, 30 Jun 2022 15:46:33 +0200 Message-Id: <20220630133234.501028667@linuxfoundation.org> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220630133233.910803744@linuxfoundation.org> References: <20220630133233.910803744@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