Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp689661pxb; Tue, 5 Apr 2022 18:54:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzuFOeXHBNZG0Xx6Bm1F5VGpXLkEusa5znetmeX3y/NhHkFM6NHbYFpCmdNtfoqtGSn01z6 X-Received: by 2002:a17:903:93:b0:156:9135:ac80 with SMTP id o19-20020a170903009300b001569135ac80mr6215524pld.145.1649210001995; Tue, 05 Apr 2022 18:53:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649210001; cv=none; d=google.com; s=arc-20160816; b=RZfL2Yc6fhEpFmfHg8GHRC/EMhyRriyjjMjjqXdWPSb1enOX6TTv/6ebcYyzBf+ot3 MWXOWuYoQgcdKIjDf8IJOvS5kQ+2Yv7xo+qeGK7UD4hx/jAvZl864xhXUj+hBz8RXJ47 t8Qv1D7Zj+yqrq6FOKNE8UDSPJAYI06VvXJJF3z/kIvzyROE50qUmBEnDhhaHHUrjMHR pADfXxaqKJvCqyYMpwS+qk3Xi9g3cQMihgqZ6hjIOJVeW5zgp8fr/QpLGcFg8q7RMSjP SO5K+3lPysCa5tffW1JCTV/r4kovn0qYKEx4yMXhWR48/Nvty/7kqsBmeUZ0jrhiFkX3 /jXw== 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=BYshnGlXdMoQc/dnOuK/tCy1oDFB6IbGTlS7yZdUMyg=; b=FMp3vlHVpRnWuECkzo58YD9IL5VFVuwkAL1KVP7RABHcRwGyWkHUt51bvWNkDZJm5L 07cJWDeCmU4rgzVeBPF7xqLXOAAvIW3VDVRqYZdJv/EL7HazuJ9pYDSrpocv+sBLFnsq qO09KHrs8ITIWdQi+RHzxynzmla+DtzQU7wVFhoVNtj/Y7U2mKezpElircnMYIPOrkXo g2ma1pZNfTI8C/NGjVoOzDsMP+rYqo7w3sJCG3mR41q07P3Hn1Ibojab9ciJU8yleeg1 5SzioNGKf3m14+M9Gad3919RPbKYAPCMoosKR00A6KvDBMtsPeeV0fm1si6icdcEIdFM u+2Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=BzObTyRP; 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 r9-20020a639b09000000b003816043ef57si14800528pgd.332.2022.04.05.18.53.06; Tue, 05 Apr 2022 18:53:21 -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=BzObTyRP; 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 S1345318AbiDEON2 (ORCPT + 99 others); Tue, 5 Apr 2022 10:13:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59040 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236224AbiDEJbN (ORCPT ); Tue, 5 Apr 2022 05:31:13 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6256119C; Tue, 5 Apr 2022 02:18:41 -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 dfw.source.kernel.org (Postfix) with ESMTPS id F162861659; Tue, 5 Apr 2022 09:18:40 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 09768C385A2; Tue, 5 Apr 2022 09:18:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649150320; bh=e/crs+wo0KFs4FTwfhb1EJaXKtseypBMYAnyvXrdg+Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BzObTyRPKo0MMVQqUq5DO6o2iR4TJ/CH78Obx0bAlo+BKjK9NPkQQeoijDujcFw+G 9PPWhPjxsgHVsiJIYROloieF0kooSubeSwADgd5rso1AY+IoLo2yyDzXetquagB6F0 1q0b967ZacnlYG4b84RhdxuqiseSAcPGsWj0Q8eQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Marcelo Roberto Jimenez , Bartosz Golaszewski , Sasha Levin Subject: [PATCH 5.15 016/913] gpio: Revert regression in sysfs-gpio (gpiolib.c) Date: Tue, 5 Apr 2022 09:17:58 +0200 Message-Id: <20220405070340.301466033@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220405070339.801210740@linuxfoundation.org> References: <20220405070339.801210740@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.1 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: Marcelo Roberto Jimenez [ Upstream commit fc328a7d1fcce263db0b046917a66f3aa6e68719 ] Some GPIO lines have stopped working after the patch commit 2ab73c6d8323f ("gpio: Support GPIO controllers without pin-ranges") And this has supposedly been fixed in the following patches commit 89ad556b7f96a ("gpio: Avoid using pin ranges with !PINCTRL") commit 6dbbf84603961 ("gpiolib: Don't free if pin ranges are not defined") But an erratic behavior where some GPIO lines work while others do not work has been introduced. This patch reverts those changes so that the sysfs-gpio interface works properly again. Signed-off-by: Marcelo Roberto Jimenez Signed-off-by: Bartosz Golaszewski Signed-off-by: Sasha Levin --- drivers/gpio/gpiolib.c | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c index 358f0ad9d0f8..12b59cdffdf3 100644 --- a/drivers/gpio/gpiolib.c +++ b/drivers/gpio/gpiolib.c @@ -1660,11 +1660,6 @@ static inline void gpiochip_irqchip_free_valid_mask(struct gpio_chip *gc) */ int gpiochip_generic_request(struct gpio_chip *gc, unsigned int offset) { -#ifdef CONFIG_PINCTRL - if (list_empty(&gc->gpiodev->pin_ranges)) - return 0; -#endif - return pinctrl_gpio_request(gc->gpiodev->base + offset); } EXPORT_SYMBOL_GPL(gpiochip_generic_request); @@ -1676,11 +1671,6 @@ EXPORT_SYMBOL_GPL(gpiochip_generic_request); */ void gpiochip_generic_free(struct gpio_chip *gc, unsigned int offset) { -#ifdef CONFIG_PINCTRL - if (list_empty(&gc->gpiodev->pin_ranges)) - return; -#endif - pinctrl_gpio_free(gc->gpiodev->base + offset); } EXPORT_SYMBOL_GPL(gpiochip_generic_free); -- 2.34.1