Re: [PATCH 1/9] serial: Add common rs485 device tree parsing function

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

 




On Thu, Jun 22, 2017 at 08:10:07AM +0200, Sascha Hauer wrote:
> On Wed, Jun 21, 2017 at 12:21:22PM +0200, Uwe Kleine-König wrote:
> > From: Sascha Hauer <s.hauer@xxxxxxxxxxxxxx>
> > 
> > Several drivers have the same device tree parsing code. Create
> > a common helper function for it.
> > 
> > Signed-off-by: Sascha Hauer <s.hauer@xxxxxxxxxxxxxx>
> > Signed-off-by: Uwe Kleine-König <u.kleine-koenig@xxxxxxxxxxxxxx>
> > ---
> >  drivers/tty/serial/Kconfig  |  4 ++++
> >  drivers/tty/serial/Makefile |  2 ++
> >  drivers/tty/serial/of.c     | 45 +++++++++++++++++++++++++++++++++++++++++++++
> >  include/linux/serial_core.h | 12 ++++++++++++
> >  4 files changed, 63 insertions(+)
> >  create mode 100644 drivers/tty/serial/of.c
> > 
> > diff --git a/drivers/tty/serial/Kconfig b/drivers/tty/serial/Kconfig
> > index 5c8850f7a2a0..8baef5b95bed 100644
> > --- a/drivers/tty/serial/Kconfig
> > +++ b/drivers/tty/serial/Kconfig
> > @@ -14,6 +14,10 @@ config SERIAL_EARLYCON
> >  	  the console before standard serial driver is probed. The console is
> >  	  enabled when early_param is processed.
> >  
> > +config OF_SERIAL
> > +	depends on SERIAL_CORE
> > +	def_bool y
> 
> This probably also needs a dependency on some device tree option,
> CONFIG_OF maybe?

Without CONFIG_OF of_property_read_u32_array returns -ENOSYS and
of_property_read_bool returns false. So I think (but didn't test) there
is no problem not depending on more stuff.

But maybe do:

	if (!np)
		return 1;

in of_get_rs485_mode?

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux