linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1 1/1] gpiolib: Kill unused GPIOF_EXPORT and Co
@ 2023-05-28 14:21 Andy Shevchenko
  2023-05-29 11:37 ` Linus Walleij
  0 siblings, 1 reply; 2+ messages in thread
From: Andy Shevchenko @ 2023-05-28 14:21 UTC (permalink / raw)
  To: Andy Shevchenko, Arnd Bergmann, linux-gpio, linux-doc,
	linux-kernel, linux-doc-tw-discuss
  Cc: Linus Walleij, Bartosz Golaszewski, Jonathan Corbet, Alex Shi,
	Yanteng Si, Hu Haowen

There is no use of the  GPIOF_EXPORT in the kernel. Kill it for good.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 Documentation/driver-api/gpio/legacy.rst                    | 3 ---
 Documentation/translations/zh_CN/driver-api/gpio/legacy.rst | 3 ---
 Documentation/translations/zh_TW/gpio.txt                   | 3 ---
 drivers/gpio/gpiolib-legacy.c                               | 6 ------
 include/linux/gpio.h                                        | 5 -----
 5 files changed, 20 deletions(-)

diff --git a/Documentation/driver-api/gpio/legacy.rst b/Documentation/driver-api/gpio/legacy.rst
index 78372853c6d4..c5f98a78499f 100644
--- a/Documentation/driver-api/gpio/legacy.rst
+++ b/Documentation/driver-api/gpio/legacy.rst
@@ -322,9 +322,6 @@ where 'flags' is currently defined to specify the following properties:
 	* GPIOF_OPEN_DRAIN	- gpio pin is open drain type.
 	* GPIOF_OPEN_SOURCE	- gpio pin is open source type.
 
-	* GPIOF_EXPORT_DIR_FIXED	- export gpio to sysfs, keep direction
-	* GPIOF_EXPORT_DIR_CHANGEABLE	- also export, allow changing direction
-
 since GPIOF_INIT_* are only valid when configured as output, so group valid
 combinations as:
 
diff --git a/Documentation/translations/zh_CN/driver-api/gpio/legacy.rst b/Documentation/translations/zh_CN/driver-api/gpio/legacy.rst
index 84ce2322fdba..8720970393fb 100644
--- a/Documentation/translations/zh_CN/driver-api/gpio/legacy.rst
+++ b/Documentation/translations/zh_CN/driver-api/gpio/legacy.rst
@@ -297,9 +297,6 @@ gpio_request()前将这类细节配置好,例如使用引脚控制子系统的
 	* GPIOF_OPEN_DRAIN	- gpio引脚为开漏信号
 	* GPIOF_OPEN_SOURCE	- gpio引脚为源极开路信号
 
-	* GPIOF_EXPORT_DIR_FIXED	- 将 gpio 导出到 sysfs,并保持方向
-	* GPIOF_EXPORT_DIR_CHANGEABLE	- 同样是导出, 但允许改变方向
-
 因为 GPIOF_INIT_* 仅有在配置为输出的时候才存在,所以有效的组合为:
 
 	* GPIOF_IN		- 配置为输入
diff --git a/Documentation/translations/zh_TW/gpio.txt b/Documentation/translations/zh_TW/gpio.txt
index 62e560ffe628..e0b96d897fa7 100644
--- a/Documentation/translations/zh_TW/gpio.txt
+++ b/Documentation/translations/zh_TW/gpio.txt
@@ -303,9 +303,6 @@ gpio_request()前將這類細節配置好,例如使用 pinctrl 子系統的映
 	* GPIOF_OPEN_DRAIN	- gpio引腳爲開漏信號
 	* GPIOF_OPEN_SOURCE	- gpio引腳爲源極開路信號
 
-	* GPIOF_EXPORT_DIR_FIXED	- 將 gpio 導出到 sysfs,並保持方向
-	* GPIOF_EXPORT_DIR_CHANGEABLE	- 同樣是導出, 但允許改變方向
-
 因爲 GPIOF_INIT_* 僅有在配置爲輸出的時候才存在,所以有效的組合爲:
 
 	* GPIOF_IN		- 配置爲輸入
diff --git a/drivers/gpio/gpiolib-legacy.c b/drivers/gpio/gpiolib-legacy.c
index 028f7f504209..969f737012f6 100644
--- a/drivers/gpio/gpiolib-legacy.c
+++ b/drivers/gpio/gpiolib-legacy.c
@@ -50,12 +50,6 @@ int gpio_request_one(unsigned gpio, unsigned long flags, const char *label)
 	if (err)
 		goto free_gpio;
 
-	if (flags & GPIOF_EXPORT) {
-		err = gpiod_export(desc, flags & GPIOF_EXPORT_CHANGEABLE);
-		if (err)
-			goto free_gpio;
-	}
-
 	return 0;
 
  free_gpio:
diff --git a/include/linux/gpio.h b/include/linux/gpio.h
index 8528353e073b..86963a00b018 100644
--- a/include/linux/gpio.h
+++ b/include/linux/gpio.h
@@ -38,11 +38,6 @@ struct device;
 /* Gpio pin is open source */
 #define GPIOF_OPEN_SOURCE	(1 << 4)
 
-#define GPIOF_EXPORT		(1 << 5)
-#define GPIOF_EXPORT_CHANGEABLE	(1 << 6)
-#define GPIOF_EXPORT_DIR_FIXED	(GPIOF_EXPORT)
-#define GPIOF_EXPORT_DIR_CHANGEABLE (GPIOF_EXPORT | GPIOF_EXPORT_CHANGEABLE)
-
 /**
  * struct gpio - a structure describing a GPIO with configuration
  * @gpio:	the GPIO number
-- 
2.40.0.1.gaa8946217a0b


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v1 1/1] gpiolib: Kill unused GPIOF_EXPORT and Co
  2023-05-28 14:21 [PATCH v1 1/1] gpiolib: Kill unused GPIOF_EXPORT and Co Andy Shevchenko
@ 2023-05-29 11:37 ` Linus Walleij
  0 siblings, 0 replies; 2+ messages in thread
From: Linus Walleij @ 2023-05-29 11:37 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: Arnd Bergmann, linux-gpio, linux-doc, linux-kernel,
	linux-doc-tw-discuss, Bartosz Golaszewski, Jonathan Corbet,
	Alex Shi, Yanteng Si, Hu Haowen

On Sun, May 28, 2023 at 4:21 PM Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:

> There is no use of the  GPIOF_EXPORT in the kernel. Kill it for good.
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

That's wonderful.
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-05-29 11:38 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-28 14:21 [PATCH v1 1/1] gpiolib: Kill unused GPIOF_EXPORT and Co Andy Shevchenko
2023-05-29 11:37 ` Linus Walleij

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).