gpiolib: finish the legacy cleanup
Subsystems (6)
v7 cover gpiolib: finish the legacy cleanup
From: Arnd Bergmann <[email protected]>
These two patches are left from my cleanup series, finishing off the work to turn off CONFIG_GPIOLIB_LEGACY by default, and removing the include/linux/gpio.h header.
I had originally planned to send these during the merge window after all the prerequisites made it in, but didn't finish that before my vacation, so I'm sending it now. I suppose this makes them 7.4 material now, but at least the first one could stil be fast-tracked to 7.3 if there is a good reason.
The second patch has to remove a few more leftover <linux/gpio.h> inclusions that made it into 7.3-rc1 either from new code or from conflicts with other changes.
Arnd Bergmann (2):
gpiolib: turn off legacy interface by default
gpiolib: remove linux/gpio.h
MAINTAINERS | 1 - arch/mips/txx9/rbtx4927/setup.c | 2 +- arch/sh/boards/mach-rsk/devices-rsk7203.c | 2 +- drivers/gpio/Kconfig | 9 +++++++- drivers/gpio/TODO | 4 +--- drivers/gpio/gpiolib-cdev.c | 2 +- drivers/gpio/gpiolib-legacy.c | 3 +-- drivers/gpio/gpiolib.c | 2 +- drivers/net/wireless/morsemicro/mm81x/hw.c | 1 - drivers/net/wireless/morsemicro/mm81x/yaps.c | 1 - include/linux/gpio.h | 22 -------------------- 11 files changed, 14 insertions(+), 35 deletions(-) delete mode 100644 include/linux/gpio.h
Signature · 11 lines
2.53.0 Cc: Thomas Bogendoerfer <[email protected]> Cc: John Paul Adrian Glaubitz <[email protected]> Cc: Kent Gibson <[email protected]> Cc: Johannes Berg <[email protected]> Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected]
PATCH v7 1/2 gpiolib: turn off legacy interface by default
From: Arnd Bergmann <[email protected]>
All users of the legacy interface now select CONFIG_GPIOLIB_LEGACY, so it can be turned off by default and only get built on platforms that still have one unconverted driver.
Allow turning it on manually for compile testing, in order to keep the build coverage of the legacy drivers in allmodconfig and randconfig.
--- drivers/gpio/Kconfig | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
drivers/gpio/Kconfig +8 -1
@@ -4,7 +4,14 @@ # config GPIOLIB_LEGACY - def_bool y + bool "Legacy GPIO interfaces" if COMPILE_TEST + help + There are a few legacy platforms that use the traditional GPIO + number based interfaces instead of GPIO descriptors. + Say Y here to enable build testing drivers that are specific + to those platforms. + + If unsure, say N. config HAVE_SHARED_GPIOS bool
Signature · 1 line
2.53.0
PATCH v7 2/2 gpiolib: remove linux/gpio.h
In reply to Arnd BergmannFrom: Arnd Bergmann <[email protected]>
After all other drivers have converted to linux/gpio/consumer.h or linux/gpio/legacy.h, remove the final leftover bits here.
--- MAINTAINERS | 1 - arch/mips/txx9/rbtx4927/setup.c | 2 +- arch/sh/boards/mach-rsk/devices-rsk7203.c | 2 +- drivers/gpio/TODO | 4 +--- drivers/gpio/gpiolib-cdev.c | 2 +- drivers/gpio/gpiolib-legacy.c | 3 +-- drivers/gpio/gpiolib.c | 2 +- drivers/net/wireless/morsemicro/mm81x/hw.c | 1 - drivers/net/wireless/morsemicro/mm81x/yaps.c | 1 - include/linux/gpio.h | 22 -------------------- 10 files changed, 6 insertions(+), 34 deletions(-) delete mode 100644 include/linux/gpio.h
MAINTAINERS +0 -1
@@ -11255,7 +11255,6 @@ F: Documentation/devicetree/bindings/gpio/ F: Documentation/driver-api/gpio/ F: drivers/gpio/ F: include/dt-bindings/gpio/ -F: include/linux/gpio.h F: include/linux/gpio/ K: (devm_)?gpio_(request|free|direction|get|set) K: GPIOD_FLAGS_BIT_NONEXCLUSIVE
arch/mips/txx9/rbtx4927/setup.c +1 -1
@@ -48,7 +48,7 @@#include <linux/ioport.h> #include <linux/platform_device.h> #include <linux/delay.h> -#include <linux/gpio.h> +#include <linux/gpio/consumer.h> #include <linux/gpio/machine.h> #include <linux/leds.h> #include <asm/io.h>
arch/sh/boards/mach-rsk/devices-rsk7203.c +1 -1
@@ -10,7 +10,7 @@#include <linux/interrupt.h> #include <linux/smsc911x.h> #include <linux/input.h> -#include <linux/gpio.h> +#include <linux/gpio/legacy.h> #include <linux/gpio_keys.h> #include <linux/leds.h> #include <asm/machvec.h>
drivers/gpio/TODO +1 -3
@@ -52,9 +52,7 @@ Work items: base can be made dynamic (set to -1) if CONFIG_GPIO_SYSFS is disabled. - When this work is complete (will require some of the items in the - following ongoing work as well) we can delete the old global - numberspace accessors from <linux/gpio.h> and eventually delete - <linux/gpio.h> altogether. + following ongoing work as well) we can delete <linux/gpio/legacy.h>. -------------------------------------------------------------------------------
drivers/gpio/gpiolib-cdev.c +1 -1
@@ -11,7 +11,7 @@#include <linux/device.h> #include <linux/err.h> #include <linux/file.h> -#include <linux/gpio.h> +#include <linux/gpio/consumer.h> #include <linux/gpio/driver.h> #include <linux/hte.h> #include <linux/interrupt.h>
drivers/gpio/gpiolib-legacy.c +1 -2
@@ -7,8 +7,7 @@#include <linux/gpio/consumer.h> #include <linux/gpio/driver.h> - -#include <linux/gpio.h> +#include <linux/gpio/legacy.h> #include "gpiolib.h"
drivers/gpio/gpiolib.c +1 -1
@@ -29,7 +29,7 @@#include <linux/string.h> #include <linux/string_choices.h> -#include <linux/gpio.h> +#include <linux/gpio/consumer.h> #include <linux/gpio/driver.h> #include <linux/gpio/machine.h>
drivers/net/wireless/morsemicro/mm81x/hw.c +0 -1
@@ -7,7 +7,6 @@#include <linux/stringify.h> #include <linux/types.h> #include <linux/unaligned.h> -#include <linux/gpio.h> #include "hif.h" #include "mac.h" #include "bus.h"
drivers/net/wireless/morsemicro/mm81x/yaps.c +0 -1
@@ -2,7 +2,6 @@/* * Copyright (c) 2017-2026 Morse Micro */ -#include <linux/gpio.h> #include <linux/random.h> #include <linux/timer.h> #include <linux/bitops.h>
include/linux/gpio.h deleted +0 -22
@@ -1,22 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -/* -* NOTE: This header *must not* be included. -* -* If you're implementing a GPIO driver, only include <linux/gpio/driver.h> -* If you're implementing a GPIO consumer, only include <linux/gpio/consumer.h> -* If you're using the legacy interfaces, include <linux/gpio/legacy.h> -*/ - -#ifndef __LINUX_GPIO_H -#define __LINUX_GPIO_H - -#include <linux/types.h> -#ifdef CONFIG_GPIOLIB -#include <linux/gpio/consumer.h> -#endif - -#ifdef CONFIG_GPIOLIB_LEGACY -#include <linux/gpio/legacy.h> -#endif /* CONFIG_GPIOLIB_LEGACY */ - -#endif /* __LINUX_GPIO_H */
Signature · 1 line
2.53.0
Re: [PATCH 1/2 v7] gpiolib: turn off legacy interface by default
In reply to Arnd BergmannQuoted 6 lines · Arnd Bergmann
From: Arnd Bergmann <[email protected]>
All users of the legacy interface now select
CONFIG_GPIOLIB_LEGACY, so it can be turned off by default and only get built on platforms that still have one unconverted driver.
Quoted 7 lines
Allow turning it on manually for compile testing, in order to keep the build coverage of the legacy drivers in allmodconfig and randconfig.
Signed-off-by Arnd Bergmann <[email protected]>
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]
In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
Re: [PATCH 2/2 v7] gpiolib: remove linux/gpio.h
In reply to Arnd BergmannQuoted 7 lines · Arnd Bergmann
From: Arnd Bergmann <[email protected]>
After all other drivers have converted to
linux/gpio/consumer.horlinux/gpio/legacy.h, remove the final leftover bits here.Signed-off-by Arnd Bergmann <[email protected]>
Gr{oetje,eeting}s,
Geert
Signature · 5 lines
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected] In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds
Quoted 5 lines · Arnd Bergmann
From: Arnd Bergmann <[email protected]>
These two patches are left from my cleanup series, finishing off the work to turn off
CONFIG_GPIOLIB_LEGACYby default, and removing theinclude/linux/gpio.hheader.
The series:
Yours,
Linus Walleij
Bartosz Golaszewski
maintainerQuoted 12 lines · Arnd Bergmann
From: Arnd Bergmann <[email protected]>
These two patches are left from my cleanup series, finishing off the work to turn off
CONFIG_GPIOLIB_LEGACYby default, and removing theinclude/linux/gpio.hheader.I had originally planned to send these during the merge window after all the prerequisites made it in, but didn't finish that before my vacation, so I'm sending it now. I suppose this makes them 7.4 material now, but at least the first one could stil be fast-tracked to 7.3 if there is a good reason.
Quoted 4 lines
The second patch has to remove a few more leftover <
linux/gpio.h> inclusions that made it into 7.3-rc1 either from new code or from conflicts with other changes.
With acks from SH and MIPS maintainers, I can take it for v7.4 through the GPIO tree.
Bart
Re: [PATCH 2/2 v7] gpiolib: remove linux/gpio.h
In reply to Arnd BergmannQuoted 10 lines · Arnd Bergmann
From: Arnd Bergmann <[email protected]>
After all other drivers have converted to
linux/gpio/consumer.horlinux/gpio/legacy.h, remove the final leftover bits here.Signed-off-by Arnd Bergmann <[email protected]>--- MAINTAINERS | 1 - arch/mips/txx9/rbtx4927/setup.c | 2 +-
Quoted 10 lines
arch/sh/boards/mach-rsk/devices-rsk7203.c | 2 +- drivers/gpio/TODO | 4 +--- drivers/gpio/gpiolib-cdev.c | 2 +- drivers/gpio/gpiolib-legacy.c | 3 +-- drivers/gpio/gpiolib.c | 2 +- drivers/net/wireless/morsemicro/mm81x/hw.c | 1 - drivers/net/wireless/morsemicro/mm81x/yaps.c | 1 - include/linux/gpio.h | 22 -------------------- 10 files changed, 6 insertions(+), 34 deletions(-) delete mode 100644 include/linux/gpio.h
Signature · 2 lines
Crap can work. Given enough thrust pigs will fly, but it's not necessarily a good idea. [ RFC1925, 2.3 ]