Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp3109152rdg; Tue, 17 Oct 2023 05:08:18 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHlZr9eJCUYcSNacot0nf4AVW88IklBqX4qO9VOUgQu+R0IG5mMSTVEBus+HVO2F+DQP/1W X-Received: by 2002:aa7:8e8b:0:b0:68f:fa05:b77a with SMTP id a11-20020aa78e8b000000b0068ffa05b77amr1598830pfr.31.1697544498037; Tue, 17 Oct 2023 05:08:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697544498; cv=none; d=google.com; s=arc-20160816; b=NIR5Y2E44VoGcLpLIstrzRAeWEUN9kzKiz6OXDekYfAkqQZo7L6pCo66JZPxhvl2lj zwSOKXjB/V+PdNWWntfwaFF1SCXVRiEVSb6/u1UTefyU7usyHLqQhYuGMo7QR+zyi+5n Is9rTUlLnE212AMFrk3dRdKkykU+5Xe3oxAjytBJRBU8nzsg33bIpCNPx59D1RAEhKmW uFwqWGJ2u/9BXmUEdlPIz9zfcUdewu0MMH2aNS/HdKgdDL/igex4lFuhVxucNglu5KbM De0UhwDFfqCS05hOLqhk4JyGkolsgw5M4/XnhsqVrAr/lrdxnF6TGRCGd8zoU1ipPTHD kBxw== 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=ThsW6Nt0Ih6GF++2vb41tY1BX2+xdfHi/vH+KQlice4=; fh=kOxmq+prcfKKX/dgMaMxTb6TRjzyc//QKXZBiaS/a94=; b=QAQjETLutpWfHSEbc0oqFJHDLaiLc+TJ7eoLK/7aspzq2d8yPuk3v5ti2PTevnrr2R 5sVTrHYT8XojyedHlIPCkrOTVqrhQG+l/ZQEePYdh9VTa4VQ3zqeSWwmlpwN1jIVA1kB LEkrIKeOhN14l4o8llBlkwZS0yhmnFUHthDpWLtFDetf/PRT9KvYVkF7QgYH9CH484eE hXJHOV6t0t2D+EwKo9yBijT3hlkcfGKg2VkAzZwMazZEZXDkBICaB0rdUYEiA3A5q/f7 sZtQlb3Lm52pRKU90Q/Ab77P3dvKvNWg/UG1R29LQt2jmfHACKtPHcEb6P7C7LSZaRcg Rqqw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bgdev-pl.20230601.gappssmtp.com header.s=20230601 header.b=Yk4ph482; 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 y12-20020a056a00190c00b00690a75a318asi1599678pfi.67.2023.10.17.05.08.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Oct 2023 05:08:18 -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=Yk4ph482; 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 3B2AE801BEB1; Tue, 17 Oct 2023 05:07:36 -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 S1343631AbjJQMH0 (ORCPT + 99 others); Tue, 17 Oct 2023 08:07:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59096 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234988AbjJQMGr (ORCPT ); Tue, 17 Oct 2023 08:06:47 -0400 Received: from mail-lj1-x235.google.com (mail-lj1-x235.google.com [IPv6:2a00:1450:4864:20::235]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DE49E1BD5 for ; Tue, 17 Oct 2023 05:05:27 -0700 (PDT) Received: by mail-lj1-x235.google.com with SMTP id 38308e7fff4ca-2c5056059e0so60229691fa.3 for ; Tue, 17 Oct 2023 05:05:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1697544324; x=1698149124; 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=ThsW6Nt0Ih6GF++2vb41tY1BX2+xdfHi/vH+KQlice4=; b=Yk4ph482avhWk/MYlv0kIGPLxEzt83see/jgBL+IZYkMhxz9E/awwBvsxqXTwT1DJq AnoJ58RuANwNmpfIyF3yHkZZX+lFv0fupL8ycIzZTo5434kMOc78rFRI3fRjaogXnvA4 OFg+wvOLD0uuvqeNkEcbm/JyuFsqSfPNCjAI38t4Fq9o8JFYl+lPqnUEVtZZ8RId1LzT hVCnE7XD+rZoZs+NwNViZypRal5iN9q2A7d2j6iLHBkr2uG4ZLXQ9FsZ14f8Yv0QAXXl uMNZCXb7Nh7uRy0Y10fgxntS1NaXcuMis5uypUcwj6TSG1haTs5BkN+FfaXJwzgqMn7S hO3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697544324; x=1698149124; 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=ThsW6Nt0Ih6GF++2vb41tY1BX2+xdfHi/vH+KQlice4=; b=Js6ld9R3BEJHzmS9TGf/Sj8bqNLIbb5HLwUJXXuPJuIC5D2wfcVLb1gFuNKK0SJTuu p45hNrD485yFQ1nqkEVOSpcL6RM4VaNg1tH+ISnX5182FZw/qNr/jZScia7Y4zbVY0p/ ZdHaPXxARAUC31wvkha5gXQRoLj+pK0rn9hc9q1eSNEzGoDS4QZkg0z1I8kGubY/ttr6 qkg7OBZryV632ROaIXZ/KwPJJRE4KLPkibvvUARWCQPxZy2S3YiQobrKIL29jymT2T02 8hH1yZpZFjqKOdEXTegYYCbTvPjnzRrsJ5KPlLMkHOhmix79Dc3h2ArZEoQ6pA1UfPB7 t+FA== X-Gm-Message-State: AOJu0YxxuLT8wuLS4s/93kwKnrQRIxntOqwhrJkEh1mauJLtsmH1T4HD s+OpqwrabWxKnYexmv0evKRhvA== X-Received: by 2002:a05:651c:102f:b0:2c5:47f:8ff7 with SMTP id w15-20020a05651c102f00b002c5047f8ff7mr1579491ljm.18.1697544324183; Tue, 17 Oct 2023 05:05:24 -0700 (PDT) Received: from brgl-uxlite.home ([2a01:cb1d:334:ac00:f1ee:b000:ce90:ed14]) by smtp.gmail.com with ESMTPSA id a2-20020a05600c224200b00405442edc69sm1353859wmm.14.2023.10.17.05.05.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Oct 2023 05:05:23 -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 v3 37/73] pinctrl: remove pinctrl_gpio_request() Date: Tue, 17 Oct 2023 14:03:55 +0200 Message-Id: <20231017120431.68847-38-brgl@bgdev.pl> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231017120431.68847-1-brgl@bgdev.pl> References: <20231017120431.68847-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_NONE,SPF_HELO_NONE,SPF_NONE 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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Tue, 17 Oct 2023 05:07:36 -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 | 6 ---- 2 files changed, 22 insertions(+), 35 deletions(-) diff --git a/drivers/pinctrl/core.c b/drivers/pinctrl/core.c index 4a03fc1c6ba0..46e5fe90718b 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 3991271cc39f..83a414a347cf 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); @@ -78,11 +77,6 @@ pinctrl_gpio_can_use_line_new(struct gpio_chip *gc, unsigned int offset) return true; } -static inline int pinctrl_gpio_request(unsigned gpio) -{ - return 0; -} - static inline int pinctrl_gpio_request_new(struct gpio_chip *gc, unsigned int offset) { -- 2.39.2