Hi, Sascha Hauer writes: > On Wed, Nov 21, 2012 at 04:57:05PM +0100, Jean-Christophe PLAGNIOL-VILLARD wrote: > > From: Sascha Hauer <s.hauer@xxxxxxxxxxxxxx> > > > > 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@xxxxxxxxxxxxxxxxxxx ___________________________________________________________ -- To unsubscribe from this list: send the line "unsubscribe linux-serial" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html