[OpenBIOS] [commit] r1367 - trunk/openbios-devel/drivers

repository service svn at openbios.org
Mon Jan 4 13:03:29 CET 2016


Author: mcayland
Date: Mon Jan  4 13:03:29 2016
New Revision: 1367
URL: http://tracker.coreboot.org/trac/openbios/changeset/1367

Log:
ide: use REGISTER_NAMED_NODE_PHANDLE rather than REGISTER_NAMED_NODE

There already exists a macro to create the device node and return its phandle,
so use this directly rather than having to create the node and then navigate
to its full path separately.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland at ilande.co.uk>
Reviewed-by: Alexander Graf <agraf at suse.de>
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland at ilande.co.uk>

Modified:
   trunk/openbios-devel/drivers/ide.c

Modified: trunk/openbios-devel/drivers/ide.c
==============================================================================
--- trunk/openbios-devel/drivers/ide.c	Tue Dec 29 16:50:44 2015	(r1366)
+++ trunk/openbios-devel/drivers/ide.c	Mon Jan  4 13:03:29 2016	(r1367)
@@ -1424,9 +1424,7 @@
 
                 snprintf(nodebuff, sizeof(nodebuff), "%s/" DEV_NAME, path,
                          current_channel);
-		REGISTER_NAMED_NODE(ob_ide_ctrl, nodebuff);
-
-		dnode = find_dev(nodebuff);
+		REGISTER_NAMED_NODE_PHANDLE(ob_ide_ctrl, nodebuff, dnode);
 
 #if !defined(CONFIG_PPC) && !defined(CONFIG_SPARC64)
 		props[0]=14; props[1]=0;
@@ -1471,8 +1469,7 @@
                         snprintf(nodebuff, sizeof(nodebuff),
                                  "%s/" DEV_NAME "/%s", path, current_channel,
                                  media);
-			REGISTER_NAMED_NODE(ob_ide, nodebuff);
-			dnode=find_dev(nodebuff);
+			REGISTER_NAMED_NODE_PHANDLE(ob_ide, nodebuff, dnode);
 			set_int_property(dnode, "reg", j);
 
 			/* create aliases */
@@ -1596,9 +1593,7 @@
 
                 snprintf(nodebuff, sizeof(nodebuff), "%s/" DEV_NAME, path,
                          current_channel);
-		REGISTER_NAMED_NODE(ob_ide_ctrl, nodebuff);
-
-		dnode = find_dev(nodebuff);
+		REGISTER_NAMED_NODE_PHANDLE(ob_ide_ctrl, nodebuff, dnode);
 
 		set_property(dnode, "compatible", (is_oldworld() ?
 			     "heathrow-ata" : "keylargo-ata"), 13);
@@ -1694,8 +1689,7 @@
                         snprintf(nodebuff, sizeof(nodebuff),
                                  "%s/" DEV_NAME "/%s", path, current_channel,
                                  media);
-			REGISTER_NAMED_NODE(ob_ide, nodebuff);
-			dnode = find_dev(nodebuff);
+			REGISTER_NAMED_NODE_PHANDLE(ob_ide, nodebuff, dnode);
 			set_int_property(dnode, "reg", j);
 
 			/* create aliases */



More information about the OpenBIOS mailing list