aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorSebastien Jan <s-jan@ti.com>2011-09-26 12:21:43 -0400
committerPaolo Pisati <paolo.pisati@canonical.com>2012-08-17 04:19:25 -0400
commit7719d2983fc0c62fd208446dd00bfb9472b9b441 (patch)
tree64bfa00b8d678c3efdd083082227a031e7a60001 /arch
parent8f6c4f201778ed9584d904d5e0e621c926c9dadd (diff)
OMAP2+: mailbox: fix lookups for multiple mailboxes
Re-apply the following patch. It was partially reverted by a merge with mutex addition. This fix is required because, as expected, the concerned code generates an error with gcc4.6 (but not with gcc4.5!). OMAP2+: mailbox: fix lookups for multiple mailboxes The pointer math in omap_mbox_get() is not quite right, and leads to passing NULL to strcmp() when searching for an mbox that is not first in the list. Convert to using array indexing as is done in all the other functions which walk the mbox list. Tested on OMAP2420/n810, OMAP3630/zoom3, OMAP4430/Blaze Signed-off-by: Kevin Hilman <khilman@ti.com> Signed-off-by: Tony Lindgren <tony@atomide.com> Conflicts: arch/arm/plat-omap/mailbox.c Signed-off-by: Sebastien Jan <s-jan@ti.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/plat-omap/mailbox.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/arch/arm/plat-omap/mailbox.c b/arch/arm/plat-omap/mailbox.c
index b6137aa0321..dea4a22604b 100644
--- a/arch/arm/plat-omap/mailbox.c
+++ b/arch/arm/plat-omap/mailbox.c
@@ -351,9 +351,12 @@ struct omap_mbox *omap_mbox_get(const char *name, struct notifier_block *nb)
351 return ERR_PTR(-EINVAL); 351 return ERR_PTR(-EINVAL);
352 352
353 mutex_lock(&mboxes_lock); 353 mutex_lock(&mboxes_lock);
354 for (mbox = *mboxes; mbox; mbox++) 354 for (i = 0; (_mbox = mboxes[i]); i++) {
355 if (!strcmp(mbox->name, name)) 355 if (!strcmp(_mbox->name, name)) {
356 mbox = _mbox;
356 break; 357 break;
358 }
359 }
357 360
358 if (!mbox) { 361 if (!mbox) {
359 mutex_unlock(&mboxes_lock); 362 mutex_unlock(&mboxes_lock);