Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp768758rdg; Wed, 11 Oct 2023 05:13:00 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHrOYsDfzuiSnyeeWoXRVeRPDa3GjZyruLowaoAG+Sg4KKAYh1082Lv6rEEkCzMSw49NlX7 X-Received: by 2002:a05:6e02:17cf:b0:351:526a:4b6 with SMTP id z15-20020a056e0217cf00b00351526a04b6mr29782509ilu.18.1697026380543; Wed, 11 Oct 2023 05:13:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697026380; cv=none; d=google.com; s=arc-20160816; b=q9kNm2uf7i9ohNZXZFIEAE0oTRHtZ9BDq7rOh7qYMpzc/YjNuMdptOdDieTOQfsDm+ +fskjyK+eMNwWY+6mzUSAQ8sXUqaJYTWEeM7oLkZ21/l+yETymtArVD5tQb3Xu9J/WX8 ckOp1OSMdhMuarOGIBN8bFUTUeP8idJwzEB5QK0PDrAkzThAI8iM60zpEJ9VhAv4tJRL pTETM+od35nxDzxGr2z9LnGs+2Ehtck1R1EwQR6HGzz7R/onLJ/jYe7W0IOz/JBGTVhb 0gg4AXdqF3gxKRTJgfP2Kz4r97NHbZ29jl6Mgu52hNR6FHivF0oo2qG768h/E1R7X54L wwQg== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=uVYKJ7dUlELxmiFW4y8r54186U4zVx3Xhgz6tJx0AYw=; fh=kOxmq+prcfKKX/dgMaMxTb6TRjzyc//QKXZBiaS/a94=; b=dN8Pmt/Jjhu2UvgnmQX5mgYHLngGXPQXvm5QPvtTp16yv1DPxIgAg8UQsPkVNbDPB4 IjPu+aBzs1r1bEoxvRtDFmcst3Rk1KcdTlNV/bxSvq0hW+BfTR0w+kAZ3tXJeqb3RYpU 9B+jVn0KAGVe3VVUX5V3OyL8YMNO4292Fj0GqeiD/Mz0DxBiNfd99jUfwYLVA8IVNlvZ FNYSc1/9mmi9YEtA+NFhqmWM1JGPGdBh8WIK7bALvY4uG20behsXIC/nrQfrJbJjRwLB KLMtBAvRL7zAgynbabj5hwGWgRzWjYHdDO88M2tZNLFW6W/Q5RGB6rpulTeV8CU80zpD XuMQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bgdev-pl.20230601.gappssmtp.com header.s=20230601 header.b=MDoA0aGY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id a26-20020a637f1a000000b0058c3a0497c2si3858936pgd.538.2023.10.11.05.12.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Oct 2023 05:13:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@bgdev-pl.20230601.gappssmtp.com header.s=20230601 header.b=MDoA0aGY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id CE2A7801B301; Wed, 11 Oct 2023 05:12:57 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346311AbjJKMMr (ORCPT + 99 others); Wed, 11 Oct 2023 08:12:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38296 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234951AbjJKMM2 (ORCPT ); Wed, 11 Oct 2023 08:12:28 -0400 Received: from mail-lf1-x129.google.com (mail-lf1-x129.google.com [IPv6:2a00:1450:4864:20::129]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 62521E5 for ; Wed, 11 Oct 2023 05:09:52 -0700 (PDT) Received: by mail-lf1-x129.google.com with SMTP id 2adb3069b0e04-50325ce89e9so8955339e87.0 for ; Wed, 11 Oct 2023 05:09:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1697026175; x=1697630975; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=uVYKJ7dUlELxmiFW4y8r54186U4zVx3Xhgz6tJx0AYw=; b=MDoA0aGYpynCNnsTb+4lYEHczMp+DN3WyDH/WnFh6qcRCi+mnMx/PG3O66/NkemFUF E3gPA8noJP/b4m6R/9u4H9reYpsXOM5let27S2g5dUqs1YefifDWw89jpFC202682MDh /gv2dRmvi8x+EjgYji3d+viG5SfQ25wb13gt+Qs+mc+6cBlgzlXG/4/tLrXq/1+hn/Xc SApNmfPUartnd5D8e9BYwaW9lc39S/kSSc86efvg1pOpblzzEZB3OCWbd5pREic7HVOM bgvGkaftf+//Ut+qfbDiI948OGBNhRBL9W6ZWI00IhIhN71qcYxkLqJgTZY7T0mIREZI hPyg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697026175; x=1697630975; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=uVYKJ7dUlELxmiFW4y8r54186U4zVx3Xhgz6tJx0AYw=; b=beaQm8XEIXgp4UxBmbG+5L6RDneCAckZ5h1+3RvFdrjrOVIkj6n7hXf/+y1nAa3Ky3 B/uB6SVw3sMFQSasL9uqap+1xW7WDHSEq7HIjXjotP/4sI9HTRuiOPVhPZf0WVakQ5ez XRBQgk4ghwgCwcSf0tWeoSDe3EgnRpEI6JF9mAYudZ4zjaVn1Faov4OBcvwx+tipD2KC ePdAhQrtpr1jyjh0Vx68w28CVVwpffCyFwYBYCGIfWa7qFtVM5WF653t7isqS2WbnJKp VVQrnw9xenfYMu1FZ4TOsTKGW+e/G7AvfSdvL6TF/ZfYCfgWqXWj2D9yLTJKllXVxzRu Ky0w== X-Gm-Message-State: AOJu0Yzgflb2ovCAcEReJCVAP7RSRrSanoLQ3m5N4RaBeOs7XDdN4Jik AzJKM8JeZNK02TfvbpscZqOCAw== X-Received: by 2002:a05:6512:1307:b0:500:7f71:e46b with SMTP id x7-20020a056512130700b005007f71e46bmr19422619lfu.1.1697026175434; Wed, 11 Oct 2023 05:09:35 -0700 (PDT) Received: from brgl-uxlite.home ([2a01:cb1d:334:ac00:e551:3946:26fc:f94]) by smtp.gmail.com with ESMTPSA id w21-20020a05600c015500b0040652e8ca13sm19012253wmm.43.2023.10.11.05.09.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Oct 2023 05:09:34 -0700 (PDT) From: Bartosz Golaszewski To: Linus Walleij , Andy Shevchenko Cc: linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org, Bartosz Golaszewski Subject: [PATCH v2 31/62] pinctrl: remove pinctrl_gpio_request() Date: Wed, 11 Oct 2023 14:07:59 +0200 Message-Id: <20231011120830.49324-32-brgl@bgdev.pl> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231011120830.49324-1-brgl@bgdev.pl> References: <20231011120830.49324-1-brgl@bgdev.pl> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_NONE autolearn=unavailable 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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Wed, 11 Oct 2023 05:12:58 -0700 (PDT) From: Bartosz Golaszewski There are no more users of pinctrl_gpio_request() so remove it. Signed-off-by: Bartosz Golaszewski --- drivers/pinctrl/core.c | 51 ++++++++++++++------------------ include/linux/pinctrl/consumer.h | 1 - 2 files changed, 22 insertions(+), 30 deletions(-) diff --git a/drivers/pinctrl/core.c b/drivers/pinctrl/core.c index 024e3825fa98..837d35b0e5c3 100644 --- a/drivers/pinctrl/core.c +++ b/drivers/pinctrl/core.c @@ -783,34 +783,6 @@ bool pinctrl_gpio_can_use_line_new(struct gpio_chip *gc, unsigned int offset) } EXPORT_SYMBOL_GPL(pinctrl_gpio_can_use_line_new); -/* This function is deprecated and will be removed. Don't use. */ -int pinctrl_gpio_request(unsigned gpio) -{ - struct pinctrl_dev *pctldev; - struct pinctrl_gpio_range *range; - int ret; - int pin; - - ret = pinctrl_get_device_gpio_range(gpio, &pctldev, &range); - if (ret) { - if (pinctrl_ready_for_gpio_range(gpio)) - ret = 0; - return ret; - } - - mutex_lock(&pctldev->mutex); - - /* Convert to the pin controllers number space */ - pin = gpio_to_pin(range, gpio); - - ret = pinmux_request_gpio(pctldev, range, pin, gpio); - - mutex_unlock(&pctldev->mutex); - - return ret; -} -EXPORT_SYMBOL_GPL(pinctrl_gpio_request); - /** * pinctrl_gpio_request_new() - request a single pin to be used as GPIO * @gc: GPIO chip structure from the GPIO subsystem @@ -822,7 +794,28 @@ EXPORT_SYMBOL_GPL(pinctrl_gpio_request); */ int pinctrl_gpio_request_new(struct gpio_chip *gc, unsigned int offset) { - return pinctrl_gpio_request(gc->base + offset); + struct pinctrl_gpio_range *range; + struct pinctrl_dev *pctldev; + int ret, pin; + + ret = pinctrl_get_device_gpio_range(gc->base + offset, &pctldev, + &range); + if (ret) { + if (pinctrl_ready_for_gpio_range(gc->base + offset)) + ret = 0; + return ret; + } + + mutex_lock(&pctldev->mutex); + + /* Convert to the pin controllers number space */ + pin = gpio_to_pin(range, gc->base + offset); + + ret = pinmux_request_gpio(pctldev, range, pin, gc->base + offset); + + mutex_unlock(&pctldev->mutex); + + return ret; } EXPORT_SYMBOL_GPL(pinctrl_gpio_request_new); diff --git a/include/linux/pinctrl/consumer.h b/include/linux/pinctrl/consumer.h index 105a4b0c1c14..ffce8d7dd0d3 100644 --- a/include/linux/pinctrl/consumer.h +++ b/include/linux/pinctrl/consumer.h @@ -27,7 +27,6 @@ struct pinctrl_state; /* External interface to pin control */ bool pinctrl_gpio_can_use_line_new(struct gpio_chip *gc, unsigned int offset); -int pinctrl_gpio_request(unsigned gpio); int pinctrl_gpio_request_new(struct gpio_chip *gc, unsigned int offset); void pinctrl_gpio_free(unsigned gpio); void pinctrl_gpio_free_new(struct gpio_chip *gc, unsigned int offset); -- 2.39.2