From patchwork Fri May 14 15:01:39 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felipe Contreras X-Patchwork-Id: 99629 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.3/8.14.3) with ESMTP id o4EF2JFJ031790 for ; Fri, 14 May 2010 15:02:19 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755387Ab0ENPCR (ORCPT ); Fri, 14 May 2010 11:02:17 -0400 Received: from mail-ew0-f216.google.com ([209.85.219.216]:44846 "EHLO mail-ew0-f216.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754805Ab0ENPCQ (ORCPT ); Fri, 14 May 2010 11:02:16 -0400 Received: by mail-ew0-f216.google.com with SMTP id 8so902320ewy.28 for ; Fri, 14 May 2010 08:02:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:subject:date :message-id:x-mailer:in-reply-to:references; bh=sGS+gvRmihXgrN4beNxqMSXkQNU0J9ur6+rbH2Bb8HM=; b=WddsiLD5EQD3oDRneTmJRls8+QmB2m9VIjJT626tVex4x5eqrNf+52htuIHMpVi7sh Cs62dxN2bmswy7ziiTTN8nYSpeodLYxFpljH0QyKYMOugo8XTxKMBkRZiXKnHZ/28ZCf BI5mw+4agHefZpNJSHOxzjU+LSwA4HkiD9Z6k= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; b=PVE6ZUPoVUYteCPcZztQ7/lPKrvVB/5g2ywrxJzcd8u+xmtXio12B5eGWK7vuThMPX TAmeMgO7TTYXhoJTBWdXs4pzAblzYULfIbzQxQJlPO6vYm/fif6MbNPgHDT6C/FDq+MJ SSgNagPH1RpuSLce5epjvfNNVLrpaIoVxJ8hc= Received: by 10.213.50.210 with SMTP id a18mr772091ebg.97.1273849334758; Fri, 14 May 2010 08:02:14 -0700 (PDT) Received: from localhost ([192.100.124.156]) by mx.google.com with ESMTPS id 15sm1310053ewy.12.2010.05.14.08.02.13 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 14 May 2010 08:02:13 -0700 (PDT) From: Felipe Contreras To: linux-omap Cc: linux-arm , Hiroshi Doyu , Tony Lindgren , Russell King , Felipe Contreras Subject: [PATCH v2 06/17] omap: mailbox: update omap1 probing Date: Fri, 14 May 2010 18:01:39 +0300 Message-Id: <1273849310-32169-7-git-send-email-felipe.contreras@gmail.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1273849310-32169-1-git-send-email-felipe.contreras@gmail.com> References: <1273849310-32169-1-git-send-email-felipe.contreras@gmail.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]); Fri, 14 May 2010 15:02:19 +0000 (UTC) diff --git a/arch/arm/mach-omap1/mailbox.c b/arch/arm/mach-omap1/mailbox.c index 15bf2a2..211b9fc 100644 --- a/arch/arm/mach-omap1/mailbox.c +++ b/arch/arm/mach-omap1/mailbox.c @@ -146,12 +146,7 @@ EXPORT_SYMBOL(mbox_dsp_info); static int __devinit omap1_mbox_probe(struct platform_device *pdev) { struct resource *res; - - if (pdev->num_resources != 2) { - dev_err(&pdev->dev, "invalid number of resources: %d\n", - pdev->num_resources); - return -ENODEV; - } + int ret; /* MBOX base */ res = platform_get_resource(pdev, IORESOURCE_MEM, 0); @@ -161,27 +156,32 @@ static int __devinit omap1_mbox_probe(struct platform_device *pdev) } mbox_base = ioremap(res->start, resource_size(res)); - if (!mbox_base) { - dev_err(&pdev->dev, "ioremap failed\n"); - return -ENODEV; - } + if (!mbox_base) + return -ENOMEM; /* DSP IRQ */ res = platform_get_resource(pdev, IORESOURCE_IRQ, 0); if (unlikely(!res)) { dev_err(&pdev->dev, "invalid irq resource\n"); - iounmap(mbox_base); - return -ENODEV; + ret = -ENODEV; + goto err_out; } mbox_dsp_info.irq = res->start; - return omap_mbox_register(&pdev->dev, &mbox_dsp_info); + ret = omap_mbox_register(&pdev->dev, &mbox_dsp_info); + if (ret) + goto err_out; + return 0; + +err_out: + iounmap(mbox_base); + return ret; } static int __devexit omap1_mbox_remove(struct platform_device *pdev) { omap_mbox_unregister(&mbox_dsp_info); - + iounmap(mbox_base); return 0; }