[PATCH 1/4] OF: Add helper for matching against linux, stdout-path
Lothar Waßmann
LW at KARO-electronics.de
Thu Nov 22 16:33:13 EST 2012
Hi,
Sascha Hauer writes:
> On Wed, Nov 21, 2012 at 04:57:05PM +0100, Jean-Christophe PLAGNIOL-VILLARD wrote:
> > From: Sascha Hauer <s.hauer at pengutronix.de>
> >
> > devicetrees may have a linux,stdout-path or stdout-path property
> > in the chosen node describing the console device. This adds a helper
> > function to match a device against this property and retrieve the options
> > so a driver can call add_preferred_console for a matching device.
> >
[...]
> > + if (!tmp)
> > + return 0;
> > +
> > + dn_stdout = of_find_node_by_path(tmp);
> > +
> > + if (dn_stdout && dn_stdout == dn) {
> > + is_stdout = 1;
> > + tmp_option++;
> > + *option = kstrdup(tmp_option, GFP_KERNEL);
> > + }
> > +
> > + of_node_put(dn_stdout);
>
> dn_stdout may be NULL aswell.
>
which is handled gracefully by of_node_put()...
Lothar Waßmann
--
___________________________________________________________
Ka-Ro electronics GmbH | Pascalstraße 22 | D - 52076 Aachen
Phone: +49 2408 1402-0 | Fax: +49 2408 1402-10
Geschäftsführer: Matthias Kaussen
Handelsregistereintrag: Amtsgericht Aachen, HRB 4996
www.karo-electronics.de | info at karo-electronics.de
___________________________________________________________
More information about the devicetree-discuss
mailing list