From patchwork Fri Jun 11 15:51:41 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felipe Contreras X-Patchwork-Id: 105612 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 o5BFqZ3d023751 for ; Fri, 11 Jun 2010 15:52:35 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757970Ab0FKPwe (ORCPT ); Fri, 11 Jun 2010 11:52:34 -0400 Received: from mail-wy0-f174.google.com ([74.125.82.174]:60624 "EHLO mail-wy0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757728Ab0FKPwe (ORCPT ); Fri, 11 Jun 2010 11:52:34 -0400 Received: by mail-wy0-f174.google.com with SMTP id 40so896647wyb.19 for ; Fri, 11 Jun 2010 08:52:33 -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=VvV5hRrYXxUhEWaWr9VjymYI9OfCrcASQWA1g2gPTI8V1osPKx72h8tSrvRkQ0eyC3 t8tv2URlrFQS5EyY+UgML7UgUE0w8gzpzZ/AqcGRzL+gLqyRbz+pCz0U/bIRruwl3zfy 9Wsjm1uVaKsYUxyWEYbqkeb8dAm8NrhKcunmk= 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=lfiSX952v8K+HFiGJSRUd8hNJi0MmMbWKdq3WbxW6BELk5KtTsdjyqEvqkSoZAbeaV RsgeZinO5C/1M4eYjXNagmGigu3s5nlQZ1UPRzf8UUwlbCB/5PbjE66VaDrc32XmdW9h B2Z8sCRBpP2JGKj30K/cKZZ1KIKxbi0QxTLCY= Received: by 10.227.137.69 with SMTP id v5mr2034759wbt.208.1276271553272; Fri, 11 Jun 2010 08:52:33 -0700 (PDT) Received: from localhost ([192.100.124.156]) by mx.google.com with ESMTPS id d75sm608882wek.32.2010.06.11.08.52.32 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 11 Jun 2010 08:52:32 -0700 (PDT) From: Felipe Contreras To: linux-omap Cc: linux-arm , Hiroshi Doyu , Tony Lindgren , Russell King , Felipe Contreras Subject: [PATCH v4 06/14] omap: mailbox: update omap1 probing Date: Fri, 11 Jun 2010 18:51:41 +0300 Message-Id: <1276271509-11983-7-git-send-email-felipe.contreras@gmail.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1276271509-11983-1-git-send-email-felipe.contreras@gmail.com> References: <1276271509-11983-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, 11 Jun 2010 15:52:36 +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; }