From patchwork Thu Mar 7 13:49:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 13585704 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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id D66FDC54798 for ; Thu, 7 Mar 2024 13:51:36 +0000 (UTC) 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=2NQt5gTc2bLxGZj72Tu0bq8G4X8UebGiX4U8+DPcTLw=; b=2OsqNKW6k+0hZm y2nixv38k3zgzV6sGPKnSjNux5a/h+OjqV4o8buSrMyfzY/VuKAOxrTW96xqDvGwPdsjikoe38HJz h7ED5Pjf7ZtRuRuR6DWxb0nd1fBv1lLxkqYEUnWGdcCo8ZUhyj+8ac43gRs0TfjP4VcK3U2Mjp9BY 3jcO+H3wf2a46SjqIIjvcvkHDpIgQOsaMYgs+jG2nIQE7POOjJ12/sfvJyLTqibvBE0FfLJbvvzM/ H4EWqSwzLU7rZZE3TmyL/gRP+7A4MDLOPZtOdfMtlrThiBg0kbCLR7lrUCCW+rSVpUY2QWs8d9dUZ plCZzKkWx76GFm3L7Imw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1riE9d-00000004s1F-2HRb; Thu, 07 Mar 2024 13:51:25 +0000 Received: from mgamail.intel.com ([198.175.65.9]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1riE9Z-00000004rw4-0nT1 for linux-arm-kernel@lists.infradead.org; Thu, 07 Mar 2024 13:51:22 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1709819481; x=1741355481; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=ygVU4Yd+yAg3WNCryrpv6ThnAM7OpsqhmDWwhxQC6j4=; b=Z9kskp3ET8G1abFktIME2MC6PbmvbDklcKcKRMD9zJXGvl+UR4aALaTf li1VTouLzDqh24TEDZy2kIRuo+8J4C5b9XAdAi+r0RQZZ0TlUXuXQYgpg AMy6nwDCxulYKcPHr4N8HO1932PwY1iwUB5UBpfEp/aL09I2HmwBLxuW/ ryVaGPWBmaKGd+jNcyTz8RnA5Xe+MiAAKIp/ppdR+p/1o/9Xn0h3ASqFR URAuqfLHUWEs9X/ncRJZ9ld2IMuunCaxmIiBtk8Q9VRbyff05A2wz40rA dMcfLb5Hee7I67CqzX9hOa76pgaa6SukJTpjZA1yiZM8q86nWtqSKcUrX A==; X-IronPort-AV: E=McAfee;i="6600,9927,11005"; a="26960338" X-IronPort-AV: E=Sophos;i="6.07,211,1708416000"; d="scan'208";a="26960338" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orvoesa101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Mar 2024 05:51:16 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,11005"; a="937046160" X-IronPort-AV: E=Sophos;i="6.07,211,1708416000"; d="scan'208";a="937046160" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga001.fm.intel.com with ESMTP; 07 Mar 2024 05:51:12 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id 052F23C0; Thu, 7 Mar 2024 15:51:10 +0200 (EET) From: Andy Shevchenko To: Andy Shevchenko , linux-gpio@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: Linus Walleij , Bartosz Golaszewski , Jonathan Corbet , Alex Shi , Yanteng Si , Hu Haowen <2023002089@link.tyut.edu.cn>, Daniel Mack , Haojian Zhuang , Robert Jarzmik , Russell King Subject: [PATCH v1 1/3] ARM: pxa: spitz: Open code gpio_request_array() Date: Thu, 7 Mar 2024 15:49:03 +0200 Message-ID: <20240307135109.3778316-2-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1.gbec44491f096 In-Reply-To: <20240307135109.3778316-1-andriy.shevchenko@linux.intel.com> References: <20240307135109.3778316-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240307_055121_335221_8D1026F3 X-CRM114-Status: GOOD ( 13.55 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org In order to prerare for removal of gpio_request_array(), open code the latter. Note, we are not using gpio_request_one() as it's also deprecated, hence reducing legacy API usage to the very basic ones. Signed-off-by: Andy Shevchenko --- arch/arm/mach-pxa/spitz_pm.c | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/arch/arm/mach-pxa/spitz_pm.c b/arch/arm/mach-pxa/spitz_pm.c index 8bc4ea51a0c1..03b4b347f11a 100644 --- a/arch/arm/mach-pxa/spitz_pm.c +++ b/arch/arm/mach-pxa/spitz_pm.c @@ -35,18 +35,20 @@ static int spitz_last_ac_status; -static struct gpio spitz_charger_gpios[] = { - { SPITZ_GPIO_KEY_INT, GPIOF_IN, "Keyboard Interrupt" }, - { SPITZ_GPIO_SYNC, GPIOF_IN, "Sync" }, - { SPITZ_GPIO_AC_IN, GPIOF_IN, "Charger Detection" }, - { SPITZ_GPIO_ADC_TEMP_ON, GPIOF_OUT_INIT_LOW, "ADC Temp On" }, - { SPITZ_GPIO_JK_B, GPIOF_OUT_INIT_LOW, "JK B" }, - { SPITZ_GPIO_CHRG_ON, GPIOF_OUT_INIT_LOW, "Charger On" }, -}; - static void spitz_charger_init(void) { - gpio_request_array(ARRAY_AND_SIZE(spitz_charger_gpios)); + gpio_request(SPITZ_GPIO_KEY_INT, "Keyboard Interrupt"); + gpio_direction_input(SPITZ_GPIO_KEY_INT); + gpio_request(SPITZ_GPIO_SYNC, "Sync"); + gpio_direction_input(SPITZ_GPIO_SYNC); + gpio_request(SPITZ_GPIO_AC_IN, "Charger Detection"); + gpio_direction_input(SPITZ_GPIO_AC_IN); + gpio_request(SPITZ_GPIO_ADC_TEMP_ON, "ADC Temp On"); + gpio_direction_output(SPITZ_GPIO_ADC_TEMP_ON, 0); + gpio_request(SPITZ_GPIO_JK_B, "JK B"); + gpio_direction_output(SPITZ_GPIO_JK_B, 0); + gpio_request(SPITZ_GPIO_CHRG_ON, "Charger On"); + gpio_direction_output(SPITZ_GPIO_CHRG_ON, 0); } static void spitz_measure_temp(int on) From patchwork Thu Mar 7 13:49:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 13585702 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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 62D63C48BF6 for ; Thu, 7 Mar 2024 13:51:34 +0000 (UTC) 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=t2ugtFOrk58iu7WeGs/28lJ3OlT3pOFldmAaTQoZCE0=; b=EYXGMg5Jtb5l/y FfVaFZPLHiWwA43D9Nec22kbuqRsnLv4GkkbewpWKg5PYZRR+pXwUTHS2xFzyg4i/ayekx7CR2xn+ p11qbNB5Xq6i9jJalXA5o9EYwvGdxsBS/JafLGMFYGhvXLNpRx8ID0wF7RAbcQc1EcGtdZPfmKzek vF9Ig/8zkE17equYlCr6xpAMwN4NP4++0izXh6lcuAouF13yy3j+ncpZMf7pZ2B3OmU0y7/+TWvzN ycErfSst5huuPvej9t30I2vj9C5unzhL3FI5duEpBsIU4E0vkQj6+oMY3zIe0SjNOscI3g0KOyIxz tcm+F25VOGVKYvImpTWA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1riE9c-00000004s0c-2gMA; Thu, 07 Mar 2024 13:51:24 +0000 Received: from mgamail.intel.com ([198.175.65.9]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1riE9X-00000004rxP-2iim for linux-arm-kernel@lists.infradead.org; Thu, 07 Mar 2024 13:51:21 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1709819480; x=1741355480; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Zl1ZwjdCwvGQxetgUvY4jVAUPX49ROq+BTSxqfQpADs=; b=jwHGZZd//5JCZqromXFqUTjOxNjz1aEG8rDfR8sG7SFyBlib/4qwaeQo RKcRIcz6BPWufUC1JYWi3lVjH6GK7nzPM5+hh/0h44PQmzHDz0nk0yIka /TAEHNC6HqBMrdKEuGRNCr5mYMcZ8q6+l50d6pVLTkRmoUDqtywEgkefS HS1FdqX3BDtnI7VOr1KJaWgbgRY+2zS5p1tXuPN5xGqNnwbBPzyDaKcVB wrwy8HVpIVM03FOlBf5nKGfu4HMpHwBsju4Ar12J4JZZbH1aPYJm0sWKw X3jRnDptgjynSv39+P0CFFNMz1T4linwJzXPDRTrCP9ozULdcKlQ66EKO A==; X-IronPort-AV: E=McAfee;i="6600,9927,11005"; a="26960314" X-IronPort-AV: E=Sophos;i="6.07,211,1708416000"; d="scan'208";a="26960314" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orvoesa101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Mar 2024 05:51:16 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,11005"; a="937046158" X-IronPort-AV: E=Sophos;i="6.07,211,1708416000"; d="scan'208";a="937046158" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga001.fm.intel.com with ESMTP; 07 Mar 2024 05:51:12 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id 157ED5BB; Thu, 7 Mar 2024 15:51:11 +0200 (EET) From: Andy Shevchenko To: Andy Shevchenko , linux-gpio@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: Linus Walleij , Bartosz Golaszewski , Jonathan Corbet , Alex Shi , Yanteng Si , Hu Haowen <2023002089@link.tyut.edu.cn>, Daniel Mack , Haojian Zhuang , Robert Jarzmik , Russell King Subject: [PATCH v1 2/3] ARM: sa1100: Open code gpio_request_array() Date: Thu, 7 Mar 2024 15:49:04 +0200 Message-ID: <20240307135109.3778316-3-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1.gbec44491f096 In-Reply-To: <20240307135109.3778316-1-andriy.shevchenko@linux.intel.com> References: <20240307135109.3778316-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240307_055119_755366_A0ED683D X-CRM114-Status: GOOD ( 15.52 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org In order to prerare for removal of gpio_request_array(), open code the latter. Note, we are not using gpio_request_one() as it's also deprecated, hence reducing legacy API usage to the very basic ones. Signed-off-by: Andy Shevchenko --- arch/arm/mach-sa1100/h3600.c | 47 +++++++++++++++++++++++++++--------- 1 file changed, 36 insertions(+), 11 deletions(-) diff --git a/arch/arm/mach-sa1100/h3600.c b/arch/arm/mach-sa1100/h3600.c index 5e25dfa752e9..1cfc0b1fa41c 100644 --- a/arch/arm/mach-sa1100/h3600.c +++ b/arch/arm/mach-sa1100/h3600.c @@ -20,16 +20,6 @@ #include "generic.h" -/* - * helper for sa1100fb - */ -static struct gpio h3600_lcd_gpio[] = { - { H3XXX_EGPIO_LCD_ON, GPIOF_OUT_INIT_LOW, "LCD power" }, - { H3600_EGPIO_LCD_PCI, GPIOF_OUT_INIT_LOW, "LCD control" }, - { H3600_EGPIO_LCD_5V_ON, GPIOF_OUT_INIT_LOW, "LCD 5v" }, - { H3600_EGPIO_LVDD_ON, GPIOF_OUT_INIT_LOW, "LCD 9v/-6.5v" }, -}; - static bool h3600_lcd_request(void) { static bool h3600_lcd_ok; @@ -38,7 +28,42 @@ static bool h3600_lcd_request(void) if (h3600_lcd_ok) return true; - rc = gpio_request_array(h3600_lcd_gpio, ARRAY_SIZE(h3600_lcd_gpio)); + rc = gpio_request(H3XXX_EGPIO_LCD_ON, "LCD power"); + if (rc) + goto out; + rc = gpio_direction_output(H3XXX_EGPIO_LCD_ON, 0); + if (rc) + goto out_free_on; + rc = gpio_request(H3600_EGPIO_LCD_PCI, "LCD control"); + if (rc) + goto out_free_on; + rc = gpio_direction_output(H3600_EGPIO_LCD_PCI, 0); + if (rc) + goto out_free_pci; + rc = gpio_request(H3600_EGPIO_LCD_5V_ON, "LCD 5v"); + if (rc) + goto out_free_pci; + rc = gpio_direction_output(H3600_EGPIO_LCD_5V_ON, 0); + if (rc) + goto out_free_5v_on; + rc = gpio_request(H3600_EGPIO_LVDD_ON, "LCD 9v/-6.5v"); + if (rc) + goto out_free_5v_on; + rc = gpio_direction_output(H3600_EGPIO_LVDD_ON, 0); + if (rc) + goto out_free_lvdd_on; + + goto out; + +out_free_lvdd_on: + gpio_free(H3600_EGPIO_LVDD_ON); +out_free_5v_on: + gpio_free(H3600_EGPIO_LCD_5V_ON); +out_free_pci: + gpio_free(H3600_EGPIO_LCD_PCI); +out_free_on: + gpio_free(H3XXX_EGPIO_LCD_ON); +out: if (rc) pr_err("%s: can't request GPIOs\n", __func__); else From patchwork Thu Mar 7 13:49:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 13585703 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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 9270EC54E49 for ; Thu, 7 Mar 2024 13:51:35 +0000 (UTC) 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=yBHwCeTtawbPgcmDSuMESiZ2TWnEyQvS8gA5QOhYiUs=; b=cC1lHJw3eoZZZ1 VHgEWJUKgaMX1rHm0K11YfbdrVxZxQNI4cNmSFaLqzrSADfoFSbFXGGnWlJdAhIcdJ/QCGaAYW3J7 K+vidyanx2XhjXq2MWgZXkGiuxZsIhVDBB3hMy0ks3eKLSIiTMDA6u+erz+aKTts9r3ihEZ18bEw8 MhMbPyJpuKQcdFoC6J43WY9IINZjT2iQQM5fMPntAlBPNosEBf9jqdIBq0REh0rogOOkRF0zCU0qU ygkUN9zQm+yyXDf7IPMJcXtmc3aTqFbmFpkdDjwOGMcwjQhZq9HhSZsykBE89+kp/B3/XaTjy3dsX nW0LHlVX30V++AY6abWg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1riE9b-00000004s0E-42VU; Thu, 07 Mar 2024 13:51:23 +0000 Received: from mgamail.intel.com ([198.175.65.9]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1riE9X-00000004rw4-240N for linux-arm-kernel@lists.infradead.org; Thu, 07 Mar 2024 13:51:20 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1709819480; x=1741355480; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=vxAMR3WP5wNBsRHuWQ+Nqapd0iPc9Ozj7J5mgbE7KXE=; b=Honkkw4KmhP7Zo7U1dFSofzQJwtMjeHWVjwj3eGpNelms/6IQU6rZuBn JHtMtlkQDSOBk08rWW5yz9hmPQwhUryUpkLu+hKoOkaKgkFgHZUtzjqeV aWFgJBjis/BB7u6cUXk2s6ygm0VAKzaGhqz0El8buY8hpohhIIr/pZtIr LOqgj5DcV03U7XCr5T8Y6OZhc1g3aROHPjr/enys7/SPl05z6bw6hjw+D ZxWTAYKTT2aXcRVPJ1Lv3rOq84vPJDYyz4uD3Pyh9sJIvKWfi98ljbq7F jfnc6Pln7muVHOwzDy/LXdY3sV8rs8F1fCBNJG4VzPZgh9IIDB1LHVYFu g==; X-IronPort-AV: E=McAfee;i="6600,9927,11005"; a="26960326" X-IronPort-AV: E=Sophos;i="6.07,211,1708416000"; d="scan'208";a="26960326" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orvoesa101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Mar 2024 05:51:16 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,11005"; a="937046159" X-IronPort-AV: E=Sophos;i="6.07,211,1708416000"; d="scan'208";a="937046159" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga001.fm.intel.com with ESMTP; 07 Mar 2024 05:51:12 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id 213A4697; Thu, 7 Mar 2024 15:51:11 +0200 (EET) From: Andy Shevchenko To: Andy Shevchenko , linux-gpio@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: Linus Walleij , Bartosz Golaszewski , Jonathan Corbet , Alex Shi , Yanteng Si , Hu Haowen <2023002089@link.tyut.edu.cn>, Daniel Mack , Haojian Zhuang , Robert Jarzmik , Russell King Subject: [PATCH v1 3/3] gpiolib: legacy: Remove unused gpio_request_array() and gpio_free_array() Date: Thu, 7 Mar 2024 15:49:05 +0200 Message-ID: <20240307135109.3778316-4-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1.gbec44491f096 In-Reply-To: <20240307135109.3778316-1-andriy.shevchenko@linux.intel.com> References: <20240307135109.3778316-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240307_055119_622901_25EEDF5C X-CRM114-Status: GOOD ( 16.55 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org No more users. Signed-off-by: Andy Shevchenko Reviewed-by: Yanteng Si --- Documentation/driver-api/gpio/legacy.rst | 16 -------- .../zh_CN/driver-api/gpio/legacy.rst | 16 -------- Documentation/translations/zh_TW/gpio.txt | 17 -------- drivers/gpio/gpiolib-legacy.c | 39 ------------------- include/linux/gpio.h | 15 ------- 5 files changed, 103 deletions(-) diff --git a/Documentation/driver-api/gpio/legacy.rst b/Documentation/driver-api/gpio/legacy.rst index b6505914791c..534dfe95d128 100644 --- a/Documentation/driver-api/gpio/legacy.rst +++ b/Documentation/driver-api/gpio/legacy.rst @@ -225,8 +225,6 @@ setup or driver probe/teardown code, so this is an easy constraint.):: gpio_request() ## gpio_request_one() - ## gpio_request_array() - ## gpio_free_array() gpio_free() @@ -295,14 +293,6 @@ are claimed, three additional calls are defined:: */ int gpio_request_one(unsigned gpio, unsigned long flags, const char *label); - /* request multiple GPIOs in a single call - */ - int gpio_request_array(struct gpio *array, size_t num); - - /* release multiple GPIOs in a single call - */ - void gpio_free_array(struct gpio *array, size_t num); - where 'flags' is currently defined to specify the following properties: * GPIOF_DIR_IN - to configure direction as input @@ -341,12 +331,6 @@ A typical example of usage:: if (err) ... - err = gpio_request_array(leds_gpios, ARRAY_SIZE(leds_gpios)); - if (err) - ... - - gpio_free_array(leds_gpios, ARRAY_SIZE(leds_gpios)); - GPIOs mapped to IRQs -------------------- diff --git a/Documentation/translations/zh_CN/driver-api/gpio/legacy.rst b/Documentation/translations/zh_CN/driver-api/gpio/legacy.rst index aeccff777170..0faf042001d2 100644 --- a/Documentation/translations/zh_CN/driver-api/gpio/legacy.rst +++ b/Documentation/translations/zh_CN/driver-api/gpio/legacy.rst @@ -208,8 +208,6 @@ GPIO 值的命令需要等待其信息排到队首才发送命令,再获得其 gpio_request() ## gpio_request_one() - ## gpio_request_array() - ## gpio_free_array() gpio_free() @@ -272,14 +270,6 @@ gpio_request()前将这类细节配置好,例如使用引脚控制子系统的 */ int gpio_request_one(unsigned gpio, unsigned long flags, const char *label); - /* 在单个函数中申请多个 GPIO - */ - int gpio_request_array(struct gpio *array, size_t num); - - /* 在单个函数中释放多个 GPIO - */ - void gpio_free_array(struct gpio *array, size_t num); - 这里 'flags' 当前定义可指定以下属性: * GPIOF_DIR_IN - 配置方向为输入 @@ -317,12 +307,6 @@ gpio_request()前将这类细节配置好,例如使用引脚控制子系统的 if (err) ... - err = gpio_request_array(leds_gpios, ARRAY_SIZE(leds_gpios)); - if (err) - ... - - gpio_free_array(leds_gpios, ARRAY_SIZE(leds_gpios)); - GPIO 映射到 IRQ ---------------- diff --git a/Documentation/translations/zh_TW/gpio.txt b/Documentation/translations/zh_TW/gpio.txt index b9b48012c62e..77d69d381316 100644 --- a/Documentation/translations/zh_TW/gpio.txt +++ b/Documentation/translations/zh_TW/gpio.txt @@ -215,13 +215,10 @@ GPIO 值的命令需要等待其信息排到隊首才發送命令,再獲得其 gpio_request() ## gpio_request_one() -## gpio_request_array() -## gpio_free_array() gpio_free() - 聲明和釋放 GPIO ---------------------------- 爲了有助於捕獲系統配置錯誤,定義了兩個函數。 @@ -278,14 +275,6 @@ gpio_request()前將這類細節配置好,例如使用 pinctrl 子系統的映 */ int gpio_request_one(unsigned gpio, unsigned long flags, const char *label); - /* 在單個函數中申請多個 GPIO - */ - int gpio_request_array(struct gpio *array, size_t num); - - /* 在單個函數中釋放多個 GPIO - */ - void gpio_free_array(struct gpio *array, size_t num); - 這裡 'flags' 當前定義可指定以下屬性: * GPIOF_DIR_IN - 配置方向爲輸入 @@ -323,12 +312,6 @@ gpio_request()前將這類細節配置好,例如使用 pinctrl 子系統的映 if (err) ... - err = gpio_request_array(leds_gpios, ARRAY_SIZE(leds_gpios)); - if (err) - ... - - gpio_free_array(leds_gpios, ARRAY_SIZE(leds_gpios)); - GPIO 映射到 IRQ -------------------- diff --git a/drivers/gpio/gpiolib-legacy.c b/drivers/gpio/gpiolib-legacy.c index 3392e758d36f..5a9911ae9125 100644 --- a/drivers/gpio/gpiolib-legacy.c +++ b/drivers/gpio/gpiolib-legacy.c @@ -72,42 +72,3 @@ int gpio_request(unsigned gpio, const char *label) return gpiod_request(desc, label); } EXPORT_SYMBOL_GPL(gpio_request); - -/** - * gpio_request_array - request multiple GPIOs in a single call - * @array: array of the 'struct gpio' - * @num: how many GPIOs in the array - * - * **DEPRECATED** This function is deprecated and must not be used in new code. - */ -int gpio_request_array(const struct gpio *array, size_t num) -{ - int i, err; - - for (i = 0; i < num; i++, array++) { - err = gpio_request_one(array->gpio, array->flags, array->label); - if (err) - goto err_free; - } - return 0; - -err_free: - while (i--) - gpio_free((--array)->gpio); - return err; -} -EXPORT_SYMBOL_GPL(gpio_request_array); - -/** - * gpio_free_array - release multiple GPIOs in a single call - * @array: array of the 'struct gpio' - * @num: how many GPIOs in the array - * - * **DEPRECATED** This function is deprecated and must not be used in new code. - */ -void gpio_free_array(const struct gpio *array, size_t num) -{ - while (num--) - gpio_free((array++)->gpio); -} -EXPORT_SYMBOL_GPL(gpio_free_array); diff --git a/include/linux/gpio.h b/include/linux/gpio.h index f4e5406554bb..56ac7e7a2889 100644 --- a/include/linux/gpio.h +++ b/include/linux/gpio.h @@ -120,8 +120,6 @@ static inline int gpio_to_irq(unsigned gpio) } int gpio_request_one(unsigned gpio, unsigned long flags, const char *label); -int gpio_request_array(const struct gpio *array, size_t num); -void gpio_free_array(const struct gpio *array, size_t num); /* CONFIG_GPIOLIB: bindings for managed devices that want to request gpios */ @@ -152,11 +150,6 @@ static inline int gpio_request_one(unsigned gpio, return -ENOSYS; } -static inline int gpio_request_array(const struct gpio *array, size_t num) -{ - return -ENOSYS; -} - static inline void gpio_free(unsigned gpio) { might_sleep(); @@ -165,14 +158,6 @@ static inline void gpio_free(unsigned gpio) WARN_ON(1); } -static inline void gpio_free_array(const struct gpio *array, size_t num) -{ - might_sleep(); - - /* GPIO can never have been requested */ - WARN_ON(1); -} - static inline int gpio_direction_input(unsigned gpio) { return -ENOSYS;