From patchwork Fri Feb 11 19:56:43 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Hilman X-Patchwork-Id: 550541 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p1BJwCJN031191 for ; Fri, 11 Feb 2011 19:58:12 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757365Ab1BKT6J (ORCPT ); Fri, 11 Feb 2011 14:58:09 -0500 Received: from na3sys009aog113.obsmtp.com ([74.125.149.209]:33067 "EHLO na3sys009aog113.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756811Ab1BKT6I (ORCPT ); Fri, 11 Feb 2011 14:58:08 -0500 Received: from source ([209.85.213.51]) (using TLSv1) by na3sys009aob113.postini.com ([74.125.148.12]) with SMTP ID DSNKTVWUz1FqNrApBszwkR/gTlnRBL6sn2wH@postini.com; Fri, 11 Feb 2011 11:58:08 PST Received: by mail-yw0-f51.google.com with SMTP id 5so1212879ywl.10 for ; Fri, 11 Feb 2011 11:58:07 -0800 (PST) Received: by 10.236.95.173 with SMTP id p33mr1699975yhf.44.1297454193544; Fri, 11 Feb 2011 11:56:33 -0800 (PST) Received: from localhost (c-24-18-179-55.hsd1.wa.comcast.net [24.18.179.55]) by mx.google.com with ESMTPS id i4sm736691yha.21.2011.02.11.11.56.32 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 11 Feb 2011 11:56:32 -0800 (PST) From: Kevin Hilman To: linux-omap@vger.kernel.org, Hiroshi DOYU Cc: linux-arm-kernel@lists.infradead.org Subject: [PATCH 2/2] OMAP2+: mailbox: fix lookups for multiple mailboxes Date: Fri, 11 Feb 2011 11:56:43 -0800 Message-Id: <1297454203-28298-2-git-send-email-khilman@ti.com> X-Mailer: git-send-email 1.7.4 In-Reply-To: <1297454203-28298-1-git-send-email-khilman@ti.com> References: <1297454203-28298-1-git-send-email-khilman@ti.com> Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Fri, 11 Feb 2011 19:58:12 +0000 (UTC) diff --git a/arch/arm/plat-omap/mailbox.c b/arch/arm/plat-omap/mailbox.c index 459b319..49d3208 100644 --- a/arch/arm/plat-omap/mailbox.c +++ b/arch/arm/plat-omap/mailbox.c @@ -322,15 +322,18 @@ static void omap_mbox_fini(struct omap_mbox *mbox) struct omap_mbox *omap_mbox_get(const char *name, struct notifier_block *nb) { - struct omap_mbox *mbox; - int ret; + struct omap_mbox *_mbox, *mbox = NULL; + int i, ret; if (!mboxes) return ERR_PTR(-EINVAL); - for (mbox = *mboxes; mbox; mbox++) - if (!strcmp(mbox->name, name)) + for (i = 0; (_mbox = mboxes[i]); i++) { + if (!strcmp(_mbox->name, name)) { + mbox = _mbox; break; + } + } if (!mbox) return ERR_PTR(-ENOENT);