Skip to contentSkip to conversation

devices: Use list_add_tail() instead of list_add() to register a device

PATCH New Stefan Roese 2 participants 2 messages Sep 5, 2008

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 devices: Use list_add_tail() instead of list_add() to register a device

This patch fixes a problem spotted on Glacier/Canyonlands (and most likely lots of other board ports), that no serial output was seen after console initialization in console_init_r(). This is because the last added console device was used instead of the first added.

This patch fixes this problem by using list_add_tail() instead of list_add() to register a device. This way the first added console is used again.

---
 common/devices.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
common/devices.c +1 -1
index 8beebe2..7d0ac2e 100644
@@ -155,7 +155,7 @@ int device_register (device_t * dev)
 	_dev = device_clone(dev);
 	if(!_dev)
 		return -1;
-	list_add(&(_dev->list), &(devs.list));
+	list_add_tail(&(_dev->list), &(devs.list));
 	return 0;
 }
 
Signature · 1 line
1.5.6.5
#1 lore raw

PATCH 1/1 devices: Use list_add_tail() instead of list_add() to register a device

Dear Stefan Roese,

Quoted 5 lines · In message <[email protected]> you wrote:

This patch fixes a problem spotted on Glacier/Canyonlands (and most likely lots of other board ports), that no serial output was seen after console initialization in console_init_r(). This is because the last added console device was used instead of the first added.

Quoted 8 lines

This patch fixes this problem by using list_add_tail() instead of list_add() to register a device. This way the first added console is used again.

---
 common/devices.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Thanks, applied.

Best regards,

Wolfgang Denk

Signature · 7 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
"Pardon me for breathing, which I never do anyway so I don't know why
I bother to say it, oh God, I'm so depressed. Here's another of those
self-satisfied doors. Life! Don't talk to me about life."
                                        - Marvin the Paranoid Android