From: u.kleine-koenig@pengutronix.de (Uwe Kleine-König)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 4/4] tty/serial: sh-sci: remove uneeded IS_ERR_OR_NULL calls
Date: Thu, 16 Mar 2017 17:37:31 +0100 [thread overview]
Message-ID: <20170316163731.xfx7ybtgdadzbh3m@pengutronix.de> (raw)
In-Reply-To: <CACRpkdYeFyr4yjQjDAUpPJwuD_NW2y=wXnzt1xSNoOX0SFCLmw@mail.gmail.com>
On Thu, Mar 16, 2017 at 04:18:52PM +0100, Linus Walleij wrote:
> On Mon, Mar 6, 2017 at 11:02 AM, Uwe Kleine-K?nig
> <u.kleine-koenig@pengutronix.de> wrote:
> > On Mon, Mar 06, 2017 at 10:53:27AM +0100, Geert Uytterhoeven wrote:
> >> On Mon, Mar 6, 2017 at 10:30 AM, Uwe Kleine-K?nig
>
> >> > I wouldn't want to code this in each driver (something like:
> >> >
> >> > if (IS_ENABLED(GPIOLIB) || device_is_instantiated_by_dt(dev) || device_is_instantiated_by_acpi(dev))
> >> > gpios = mctrl_gpio_init(...);
> >> > else
> >> > gpios = NULL;
> >> >
> >> > ). Putting this into GPIOLIB is the right approach, and so this is
> >> > another argument for HALFGPIOLIB. This would fix mctrl_gpio_init en
> >> > passant.
> >>
> >> Do we have platforms where DT=y || ACPI=y, but GPIOLIB=n?
> >> Ah, x86 ;-)
> >
> > Yeah, and I think rm -r arch/x86 won't be acceptable :-) I assume you
> > can also configure some arm or powerpc systems without GPIOLIB.
> >
> >> Anyway, for sh-sci.c, platforms either have DT and GPIOLIB, or they do not
> >> need mctrl-gpio.
> >
> > So we're in agreement now that HALFGPIOLIB is the way to go?
> > Linus, what do you think?
>
> OK modem lines over GPIO.
>
> So the problem is that GPIOLIB is needed (obviously) for mctrl_gpio_init() to
> work properly, and then there are some stubs in
> drivers/tty/serial/serial_mctrl_gpio.h
> for !GPIOLIB.
>
> And this whole discussion is all about that !GPIOLIB case really,
> whether DT, ACPI, SFI or board files machine data is used doesn't
> really matter.
>
> We're talking about:
>
> > git grep mctrl_gpio_init
> drivers/tty/serial/atmel_serial.c: atmel_port->gpios =
> mctrl_gpio_init(&atmel_port->uart, 0);
> drivers/tty/serial/clps711x.c: s->gpios =
> mctrl_gpio_init_noauto(&pdev->dev, 0);
> drivers/tty/serial/etraxfs-uart.c: up->gpios =
> mctrl_gpio_init_noauto(&pdev->dev, 0);
> drivers/tty/serial/imx.c: sport->gpios = mctrl_gpio_init(&sport->port, 0);
> drivers/tty/serial/mxs-auart.c: s->gpios = mctrl_gpio_init_noauto(dev, 0);
> drivers/tty/serial/sh-sci.c: sciport->gpios =
> mctrl_gpio_init(&sciport->port, 0);
>
> Atmel, ARM, ETRAX, ARM, ARM, Super-H, all have GPIOLIB.
> Right now no x86, correct?
>
> 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?
Would be ok for me, too. People seem to object to that though.
Best regards
Uwe
--
Pengutronix e.K. | Uwe Kleine-K?nig |
Industrial Linux Solutions | http://www.pengutronix.de/ |
next prev parent reply other threads:[~2017-03-16 16:37 UTC|newest]
Thread overview: 44+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-03 14:22 [PATCH 4/4] tty/serial: sh-sci: remove uneeded IS_ERR_OR_NULL calls Richard Genoud
2017-03-03 18:58 ` Geert Uytterhoeven
2017-03-03 19:12 ` Uwe Kleine-König
2017-03-03 19:21 ` Geert Uytterhoeven
2017-03-03 19:44 ` Uwe Kleine-König
2017-03-04 15:35 ` Geert Uytterhoeven
2017-03-04 17:48 ` Uwe Kleine-König
2017-03-06 8:49 ` Geert Uytterhoeven
2017-03-06 8:58 ` Uwe Kleine-König
2017-03-06 9:09 ` Geert Uytterhoeven
2017-03-06 9:30 ` Uwe Kleine-König
2017-03-06 9:53 ` Geert Uytterhoeven
2017-03-06 10:02 ` Uwe Kleine-König
2017-03-14 15:32 ` Linus Walleij
2017-03-16 15:18 ` Linus Walleij
2017-03-16 16:37 ` Uwe Kleine-König [this message]
2017-03-16 16:38 ` Geert Uytterhoeven
2017-03-20 9:56 ` Geert Uytterhoeven
2017-03-20 10:03 ` Geert Uytterhoeven
2017-03-20 10:31 ` Uwe Kleine-König
2017-03-20 10:38 ` Geert Uytterhoeven
2017-03-20 11:07 ` Uwe Kleine-König
2017-03-23 9:32 ` Linus Walleij
2017-03-23 10:10 ` Uwe Kleine-König
2017-03-23 10:20 ` Geert Uytterhoeven
2017-03-23 11:11 ` Uwe Kleine-König
2017-03-23 12:03 ` Geert Uytterhoeven
2017-03-23 12:34 ` Uwe Kleine-König
2017-03-23 12:44 ` Geert Uytterhoeven
2017-03-23 13:41 ` Linus Walleij
2017-03-23 14:43 ` Dmitry Torokhov
2017-03-23 15:44 ` Dmitry Torokhov
2017-03-23 19:10 ` Uwe Kleine-König
2017-03-23 19:58 ` Dmitry Torokhov
2017-03-24 8:00 ` Uwe Kleine-König
2017-03-24 8:29 ` Geert Uytterhoeven
2017-03-24 8:39 ` Uwe Kleine-König
2017-03-24 8:59 ` Geert Uytterhoeven
2017-03-24 9:15 ` Uwe Kleine-König
2017-03-24 9:44 ` Geert Uytterhoeven
2017-03-24 10:01 ` Uwe Kleine-König
2017-03-24 8:58 ` Linus Walleij
2017-03-23 15:55 ` Dmitry Torokhov
2017-03-23 13:37 ` Linus Walleij
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170316163731.xfx7ybtgdadzbh3m@pengutronix.de \
--to=u.kleine-koenig@pengutronix.de \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).