aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mfd/ucb1x00-core.c
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@arm.linux.org.uk>2012-01-21 10:35:01 -0500
committerRussell King <rmk+kernel@arm.linux.org.uk>2012-02-18 18:15:35 -0500
commit65b539bb900f64b9a3f9b761bf0f735dc84e6b70 (patch)
tree5a58bfe05f04f6383edcbced0f1993e76a40bcab /drivers/mfd/ucb1x00-core.c
parent7655b2ac9ed3206fb916357b8b1065f08324507d (diff)
MFD: ucb1x00-core: scan drivers in same order they're registered
Cosmetic patch to scan the list of drivers in the order that the drivers are registered, rather than the reverse order. This avoids surprises when drivers get probed in the reverse order, and input devices get registered in a different order due to bind/unbind than from boot. Acked-by: Jochen Friedrich <jochen@scram.de> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'drivers/mfd/ucb1x00-core.c')
-rw-r--r--drivers/mfd/ucb1x00-core.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/mfd/ucb1x00-core.c b/drivers/mfd/ucb1x00-core.c
index 30ef726f4ba0..162496de1b38 100644
--- a/drivers/mfd/ucb1x00-core.c
+++ b/drivers/mfd/ucb1x00-core.c
@@ -436,8 +436,8 @@ static int ucb1x00_add_dev(struct ucb1x00 *ucb, struct ucb1x00_driver *drv)
436 ret = drv->add(dev); 436 ret = drv->add(dev);
437 437
438 if (ret == 0) { 438 if (ret == 0) {
439 list_add(&dev->dev_node, &ucb->devs); 439 list_add_tail(&dev->dev_node, &ucb->devs);
440 list_add(&dev->drv_node, &drv->devs); 440 list_add_tail(&dev->drv_node, &drv->devs);
441 } else { 441 } else {
442 kfree(dev); 442 kfree(dev);
443 } 443 }
@@ -605,7 +605,7 @@ static int ucb1x00_probe(struct mcp *mcp)
605 605
606 INIT_LIST_HEAD(&ucb->devs); 606 INIT_LIST_HEAD(&ucb->devs);
607 mutex_lock(&ucb1x00_mutex); 607 mutex_lock(&ucb1x00_mutex);
608 list_add(&ucb->node, &ucb1x00_devices); 608 list_add_tail(&ucb->node, &ucb1x00_devices);
609 list_for_each_entry(drv, &ucb1x00_drivers, node) { 609 list_for_each_entry(drv, &ucb1x00_drivers, node) {
610 ucb1x00_add_dev(ucb, drv); 610 ucb1x00_add_dev(ucb, drv);
611 } 611 }
@@ -663,7 +663,7 @@ int ucb1x00_register_driver(struct ucb1x00_driver *drv)
663 663
664 INIT_LIST_HEAD(&drv->devs); 664 INIT_LIST_HEAD(&drv->devs);
665 mutex_lock(&ucb1x00_mutex); 665 mutex_lock(&ucb1x00_mutex);
666 list_add(&drv->node, &ucb1x00_drivers); 666 list_add_tail(&drv->node, &ucb1x00_drivers);
667 list_for_each_entry(ucb, &ucb1x00_devices, node) { 667 list_for_each_entry(ucb, &ucb1x00_devices, node) {
668 ucb1x00_add_dev(ucb, drv); 668 ucb1x00_add_dev(ucb, drv);
669 } 669 }