From patchwork Wed Jun 23 00:11:35 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ohad Ben Cohen X-Patchwork-Id: 107521 X-Patchwork-Delegate: hiroshi.doyu@nokia.com Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.4/8.14.3) with ESMTP id o5N0C8TT022157 for ; Wed, 23 Jun 2010 00:12:09 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752974Ab0FWALt (ORCPT ); Tue, 22 Jun 2010 20:11:49 -0400 Received: from mail-ww0-f46.google.com ([74.125.82.46]:35608 "EHLO mail-ww0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752738Ab0FWALs (ORCPT ); Tue, 22 Jun 2010 20:11:48 -0400 Received: by wwc33 with SMTP id 33so584176wwc.19 for ; Tue, 22 Jun 2010 17:11:47 -0700 (PDT) Received: by 10.216.155.141 with SMTP id j13mr5298166wek.7.1277251906817; Tue, 22 Jun 2010 17:11:46 -0700 (PDT) Received: from localhost.localdomain (89-139-43-41.bb.netvision.net.il [89.139.43.41]) by mx.google.com with ESMTPS id d37sm5042171wej.42.2010.06.22.17.11.45 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 22 Jun 2010 17:11:46 -0700 (PDT) From: Ohad Ben-Cohen To: Cc: Hiroshi Doyu , Omar Ramirez Luna , Ohad Ben-Cohen Subject: [PATCH 3/4] omap mailbox: remove mbox_configured scheme Date: Wed, 23 Jun 2010 03:11:35 +0300 Message-Id: <1277251896-6890-3-git-send-email-ohad@wizery.com> X-Mailer: git-send-email 1.7.0.4 In-Reply-To: <1277251896-6890-1-git-send-email-ohad@wizery.com> References: <1277251896-6890-1-git-send-email-ohad@wizery.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.3 (demeter.kernel.org [140.211.167.41]); Wed, 23 Jun 2010 00:12:09 +0000 (UTC) diff --git a/arch/arm/plat-omap/mailbox.c b/arch/arm/plat-omap/mailbox.c index aafa63f..6a9dfe5 100644 --- a/arch/arm/plat-omap/mailbox.c +++ b/arch/arm/plat-omap/mailbox.c @@ -35,9 +35,6 @@ static struct workqueue_struct *mboxd; static struct omap_mbox **mboxes; static bool rq_full; -static int mbox_configured; -static DEFINE_MUTEX(mbox_configured_lock); - static unsigned int mbox_kfifo_size = CONFIG_OMAP_MBOX_KFIFO_SIZE; module_param(mbox_kfifo_size, uint, S_IRUGO); MODULE_PARM_DESC(mbox_kfifo_size, "Size of omap's mailbox kfifo (bytes)"); @@ -240,16 +237,9 @@ static int omap_mbox_startup(struct omap_mbox *mbox) struct omap_mbox_queue *mq; if (mbox->ops->startup) { - mutex_lock(&mbox_configured_lock); - if (!mbox_configured) - ret = mbox->ops->startup(mbox); - - if (ret) { - mutex_unlock(&mbox_configured_lock); + ret = mbox->ops->startup(mbox); + if (ret) return ret; - } - mbox_configured++; - mutex_unlock(&mbox_configured_lock); } ret = request_irq(mbox->irq, mbox_interrupt, IRQF_SHARED, @@ -295,14 +285,8 @@ static void omap_mbox_fini(struct omap_mbox *mbox) mbox_queue_free(mbox->txq); mbox_queue_free(mbox->rxq); - if (mbox->ops->shutdown) { - mutex_lock(&mbox_configured_lock); - if (mbox_configured > 0) - mbox_configured--; - if (!mbox_configured) - mbox->ops->shutdown(mbox); - mutex_unlock(&mbox_configured_lock); - } + if (mbox->ops->shutdown) + mbox->ops->shutdown(mbox); } struct omap_mbox *omap_mbox_get(const char *name, int (*callback)(void *))