Re: [PATCH 4/4] tty/serial: sh-sci: remove uneeded IS_ERR_OR_NULL calls

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Linus,

On Thu, Mar 16, 2017 at 5:38 PM, Geert Uytterhoeven
<geert@xxxxxxxxxxxxxx> wrote:
>> They actually all even do things like this in Kconfig:
>>
>> config SERIAL_ATMEL
>> (...)
>>         select SERIAL_MCTRL_GPIO if GPIOLIB
>>
>> What stops us from removing all the stubs in
>> drivers/tty/serial/serial_mctrl_gpio.h
>> and just make SERIAL_MCTRL_GPIO depends on GPIOLIB?
>
> Removing the stubs implies adding #ifdefs to the drivers that need
> to handle the !SERIAL_MCTRL_GPIO case.
>
> E.g. I don't want to break the sh-sci serial driver on SuperH platforms that
> (a) don't select GPIOLIB, and
> (b) don't use mtrl_gpio.

Alternatively, after commit 22c403676dbbb7c6 ("gpio: return NULL from
gpiod_get_optional when GPIOLIB is disabled") we might just drop the
dependency of SERIAL_MCTRL_GPIO on GPIOLIB? Then no special handling
is needed in drivers, as all GPIOs will just be considered not present.

Documentation/gpio/consumer.txt rightfully sates:
| Note that gpio_get*_optional() functions (and their managed variants), unlike
| the rest of gpiolib API, also return NULL when gpiolib support is disabled.
| This is helpful to driver authors, since they do not need to special case
| -ENOSYS return codes.  System integrators should however be careful to enable
| gpiolib on systems that need it.

drivers/tty/serial/serial_mctrl_gpio.o already compiles fine if
CONFIG_GPIOLIB=n, which reduces its size by ca. 25%.

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx

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
--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux SPI]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux