From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7E81FC433F5 for ; Tue, 9 Nov 2021 10:02:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6DAD861179 for ; Tue, 9 Nov 2021 10:02:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245165AbhKIKFR (ORCPT ); Tue, 9 Nov 2021 05:05:17 -0500 Received: from mail.kernel.org ([198.145.29.99]:33078 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245190AbhKIKFQ (ORCPT ); Tue, 9 Nov 2021 05:05:16 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 1264861167; Tue, 9 Nov 2021 10:02:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1636452150; bh=9vK0q1Gu9w0BTlhyMWFqQaJZ6ZTjcHavcORrzYvFfs0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=eBkpmcqbZzTsG7gPPxtBtwQIv9etRQxlswIt3xjRKlFDCsOpB9JbcNNjZLSTMMf74 Hz+jUlvuu71bgO51fu7c+sPkbIrpiBDpA21iWTKqe10F+YdH99RfLIp6DSGkALko6E swrSNoy3bS5mw++lSfVVtTDv5KovUdr2tjPx6mPs2Pi16YmpOTLT6ehaTav4lmQVeW MCNX/9zxE8FBhCTjvV0xN/q5QHAUpVwXcrNiwAqXzHrwzcyTExrF42mFmFxImO0DZ8 ihYtv2Jo64EzMvLMuhTdKS3i+YTLZsaYYD/CzPD2pepbsvxpGJoDsF0qz8ei1smUhg tT8SyDgkLLkaQ== From: Arnd Bergmann To: linux-gpio@vger.kernel.org Cc: Arnd Bergmann , Linus Walleij , Bartosz Golaszewski , Andy Shevchenko , Geert Uytterhoeven , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 7/8] gpiolib: remove gpio_to_chip Date: Tue, 9 Nov 2021 11:02:06 +0100 Message-Id: <20211109100207.2474024-8-arnd@kernel.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20211109100207.2474024-1-arnd@kernel.org> References: <20211109100207.2474024-1-arnd@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org From: Arnd Bergmann There are only two callers of this helper, remove them by open-coding the call to the gpiod version. Signed-off-by: Arnd Bergmann --- drivers/pinctrl/core.c | 5 ++--- drivers/soc/fsl/qe/gpio.c | 4 +--- include/linux/gpio.h | 7 ------- 3 files changed, 3 insertions(+), 13 deletions(-) diff --git a/drivers/pinctrl/core.c b/drivers/pinctrl/core.c index 976607758e98..8d3c00782178 100644 --- a/drivers/pinctrl/core.c +++ b/drivers/pinctrl/core.c @@ -28,7 +28,6 @@ #ifdef CONFIG_GPIOLIB #include "../gpio/gpiolib.h" -#include #endif #include "core.h" @@ -324,7 +323,7 @@ static bool pinctrl_ready_for_gpio_range(unsigned gpio) { struct pinctrl_dev *pctldev; struct pinctrl_gpio_range *range = NULL; - struct gpio_chip *chip = gpio_to_chip(gpio); + struct gpio_chip *chip = gpiod_to_chip(gpio_to_desc(gpio)); if (WARN(!chip, "no gpio_chip for gpio%i?", gpio)) return false; @@ -1657,7 +1656,7 @@ static int pinctrl_pins_show(struct seq_file *s, void *what) } } if (gpio_num >= 0) - chip = gpio_to_chip(gpio_num); + chip = gpiod_to_chip(gpio_to_desc(gpio_num)); else chip = NULL; if (chip) diff --git a/drivers/soc/fsl/qe/gpio.c b/drivers/soc/fsl/qe/gpio.c index 99f7de43c3c6..a6aa55055e9a 100644 --- a/drivers/soc/fsl/qe/gpio.c +++ b/drivers/soc/fsl/qe/gpio.c @@ -15,8 +15,6 @@ #include #include #include -/* FIXME: needed for gpio_to_chip() get rid of this */ -#include #include #include #include @@ -173,7 +171,7 @@ struct qe_pin *qe_pin_request(struct device_node *np, int index) err = of_get_gpio(np, index); if (err < 0) goto err0; - gc = gpio_to_chip(err); + gc = gpiod_to_chip(gpio_to_desc(err)); if (WARN_ON(!gc)) { err = -ENODEV; goto err0; diff --git a/include/linux/gpio.h b/include/linux/gpio.h index 7ceb93678689..61fb427b4e70 100644 --- a/include/linux/gpio.h +++ b/include/linux/gpio.h @@ -96,12 +96,6 @@ static inline bool gpio_is_valid(int number) struct device; -/* caller holds gpio_lock *OR* gpio is marked as requested */ -static inline struct gpio_chip *gpio_to_chip(unsigned gpio) -{ - return gpiod_to_chip(gpio_to_desc(gpio)); -} - /* Always use the library code for GPIO management calls, * or when sleeping may be involved. */ @@ -158,7 +152,6 @@ int devm_gpio_request_one(struct device *dev, unsigned gpio, #include struct device; -struct gpio_chip; static inline bool gpio_is_valid(int number) { -- 2.29.2 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 00EAFC433EF for ; Tue, 9 Nov 2021 10:11:31 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id BBA3E61027 for ; Tue, 9 Nov 2021 10:11:30 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org BBA3E61027 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Ex4vrLiTxVJU/12NYWoJ+InXJfIzPpRMPCNq1dhC10U=; b=r0EUA+kDo4hBvr DWnLrOQxviux+n00ILzsKLO3GUorFbg4Vc5QNCHm6WLs0x7aPkuidsVE0fE1lpEXK/FTL9OaKWnIH x0NAl5RRKkj311BGirQL2e4iOUn7TOaOWdn60GTVvNkYFdWQWyVJ4kmJqhM2CiYpNegyR5ba75We7 NPZzRajvEx0YhIFenifZk9jaZyE79USyBVePnPr9v2EElL0XbhrUjvjbRHmrz50NEvTx2lhwhd3PK ek8tWV9+oogVjEJASU3YJ4jVwCW0O4lMzBmqF5++IJBrhD6VumPxJXMLbQfylM9YsiiX+AxbJf2LU d0H6tLQjWjb32gjSCM3A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mkO4f-001Qfa-Qu; Tue, 09 Nov 2021 10:09:54 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mkNxX-001OVR-0P for linux-arm-kernel@lists.infradead.org; Tue, 09 Nov 2021 10:02:32 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id 1264861167; Tue, 9 Nov 2021 10:02:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1636452150; bh=9vK0q1Gu9w0BTlhyMWFqQaJZ6ZTjcHavcORrzYvFfs0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=eBkpmcqbZzTsG7gPPxtBtwQIv9etRQxlswIt3xjRKlFDCsOpB9JbcNNjZLSTMMf74 Hz+jUlvuu71bgO51fu7c+sPkbIrpiBDpA21iWTKqe10F+YdH99RfLIp6DSGkALko6E swrSNoy3bS5mw++lSfVVtTDv5KovUdr2tjPx6mPs2Pi16YmpOTLT6ehaTav4lmQVeW MCNX/9zxE8FBhCTjvV0xN/q5QHAUpVwXcrNiwAqXzHrwzcyTExrF42mFmFxImO0DZ8 ihYtv2Jo64EzMvLMuhTdKS3i+YTLZsaYYD/CzPD2pepbsvxpGJoDsF0qz8ei1smUhg tT8SyDgkLLkaQ== From: Arnd Bergmann To: linux-gpio@vger.kernel.org Cc: Arnd Bergmann , Linus Walleij , Bartosz Golaszewski , Andy Shevchenko , Geert Uytterhoeven , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 7/8] gpiolib: remove gpio_to_chip Date: Tue, 9 Nov 2021 11:02:06 +0100 Message-Id: <20211109100207.2474024-8-arnd@kernel.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20211109100207.2474024-1-arnd@kernel.org> References: <20211109100207.2474024-1-arnd@kernel.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211109_020231_166710_D6A3EAEA X-CRM114-Status: GOOD ( 15.23 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Arnd Bergmann There are only two callers of this helper, remove them by open-coding the call to the gpiod version. Signed-off-by: Arnd Bergmann --- drivers/pinctrl/core.c | 5 ++--- drivers/soc/fsl/qe/gpio.c | 4 +--- include/linux/gpio.h | 7 ------- 3 files changed, 3 insertions(+), 13 deletions(-) diff --git a/drivers/pinctrl/core.c b/drivers/pinctrl/core.c index 976607758e98..8d3c00782178 100644 --- a/drivers/pinctrl/core.c +++ b/drivers/pinctrl/core.c @@ -28,7 +28,6 @@ #ifdef CONFIG_GPIOLIB #include "../gpio/gpiolib.h" -#include #endif #include "core.h" @@ -324,7 +323,7 @@ static bool pinctrl_ready_for_gpio_range(unsigned gpio) { struct pinctrl_dev *pctldev; struct pinctrl_gpio_range *range = NULL; - struct gpio_chip *chip = gpio_to_chip(gpio); + struct gpio_chip *chip = gpiod_to_chip(gpio_to_desc(gpio)); if (WARN(!chip, "no gpio_chip for gpio%i?", gpio)) return false; @@ -1657,7 +1656,7 @@ static int pinctrl_pins_show(struct seq_file *s, void *what) } } if (gpio_num >= 0) - chip = gpio_to_chip(gpio_num); + chip = gpiod_to_chip(gpio_to_desc(gpio_num)); else chip = NULL; if (chip) diff --git a/drivers/soc/fsl/qe/gpio.c b/drivers/soc/fsl/qe/gpio.c index 99f7de43c3c6..a6aa55055e9a 100644 --- a/drivers/soc/fsl/qe/gpio.c +++ b/drivers/soc/fsl/qe/gpio.c @@ -15,8 +15,6 @@ #include #include #include -/* FIXME: needed for gpio_to_chip() get rid of this */ -#include #include #include #include @@ -173,7 +171,7 @@ struct qe_pin *qe_pin_request(struct device_node *np, int index) err = of_get_gpio(np, index); if (err < 0) goto err0; - gc = gpio_to_chip(err); + gc = gpiod_to_chip(gpio_to_desc(err)); if (WARN_ON(!gc)) { err = -ENODEV; goto err0; diff --git a/include/linux/gpio.h b/include/linux/gpio.h index 7ceb93678689..61fb427b4e70 100644 --- a/include/linux/gpio.h +++ b/include/linux/gpio.h @@ -96,12 +96,6 @@ static inline bool gpio_is_valid(int number) struct device; -/* caller holds gpio_lock *OR* gpio is marked as requested */ -static inline struct gpio_chip *gpio_to_chip(unsigned gpio) -{ - return gpiod_to_chip(gpio_to_desc(gpio)); -} - /* Always use the library code for GPIO management calls, * or when sleeping may be involved. */ @@ -158,7 +152,6 @@ int devm_gpio_request_one(struct device *dev, unsigned gpio, #include struct device; -struct gpio_chip; static inline bool gpio_is_valid(int number) { -- 2.29.2 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel