From patchwork Wed Dec 12 14:38:07 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guennadi Liakhovetski X-Patchwork-Id: 1867301 Return-Path: X-Original-To: patchwork-linux-mmc@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id EC6F9DF215 for ; Wed, 12 Dec 2012 14:38:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754349Ab2LLOif (ORCPT ); Wed, 12 Dec 2012 09:38:35 -0500 Received: from moutng.kundenserver.de ([212.227.17.10]:59264 "EHLO moutng.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754599Ab2LLOia (ORCPT ); Wed, 12 Dec 2012 09:38:30 -0500 Received: from axis700.grange (dslb-146-060-250-080.pools.arcor-ip.net [146.60.250.80]) by mrelayeu.kundenserver.de (node=mreu1) with ESMTP (Nemesis) id 0M7Wnz-1SyETB3ZtH-00wcBY; Wed, 12 Dec 2012 15:38:23 +0100 Received: from 6a.grange (6a.grange [192.168.1.11]) by axis700.grange (Postfix) with ESMTPS id 7A8D140B9D; Wed, 12 Dec 2012 15:38:21 +0100 (CET) Received: from lyakh by 6a.grange with local (Exim 4.72) (envelope-from ) id 1TinRy-0004i8-NK; Wed, 12 Dec 2012 15:38:18 +0100 From: Guennadi Liakhovetski To: linux-mmc@vger.kernel.org Cc: linux-sh@vger.kernel.org, Magnus Damm , Chris Ball , Shinya Kuribayashi Subject: [PATCH 03/14] mmc: sh_mmcif: add support for bundled MMCIF IRQs Date: Wed, 12 Dec 2012 15:38:07 +0100 Message-Id: <1355323098-18061-4-git-send-email-g.liakhovetski@gmx.de> X-Mailer: git-send-email 1.7.2.5 In-Reply-To: <1355323098-18061-1-git-send-email-g.liakhovetski@gmx.de> References: <1355323098-18061-1-git-send-email-g.liakhovetski@gmx.de> X-Provags-ID: V02:K0:w5UwuKjJLk35oaFvTNt6tDpPaO++OXapR6MS8ch1lDe 5mgsQVyFna2xOBwlF2ttXUndb1leI843yQFqiZNEX/d84v+jU1 E01JwafrlAkHnKrNt8g4DrnqQoniM9HJWsL78d0EKym5/Q70Ds Lsbae5ShhGDGNJpY2k7org3dT0MDKmFsVqWtpgpIIqop4eAGbr DcyLd4Y1KXkUkaeX6mZrkxYFooOO2hsQiLPK/S+jzaSqqyZ41a FhSBORMzAdxecV1H+M3SCjx1QSUn9ICkk+YoOVbh/zVzXkB48Y dvhnSaGdYiTUXzeZTl/ity5LyrRzN7eE6f4e9EesggqHbRq4zB ejGY1CIwR3nLic+cK+mx60PcqR1JCMxvjVYAK+WiQ0/HXa+hpJ qSHi0uNvflrPw== Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org From: Shinya Kuribayashi On newer SoCs like R-Mobile U2, MMCIF interrupts are bundled. Signed-off-by: Shinya Kuribayashi Signed-off-by: Guennadi Liakhovetski --- drivers/mmc/host/sh_mmcif.c | 25 ++++++++++++++++--------- 1 files changed, 16 insertions(+), 9 deletions(-) diff --git a/drivers/mmc/host/sh_mmcif.c b/drivers/mmc/host/sh_mmcif.c index 8a188fe..d80c294 100644 --- a/drivers/mmc/host/sh_mmcif.c +++ b/drivers/mmc/host/sh_mmcif.c @@ -1307,10 +1307,11 @@ static int sh_mmcif_probe(struct platform_device *pdev) struct sh_mmcif_plat_data *pd = pdev->dev.platform_data; struct resource *res; void __iomem *reg; + const char *name; irq[0] = platform_get_irq(pdev, 0); irq[1] = platform_get_irq(pdev, 1); - if (irq[0] < 0 || irq[1] < 0) { + if (irq[0] < 0) { dev_err(&pdev->dev, "Get irq error\n"); return -ENXIO; } @@ -1375,15 +1376,19 @@ static int sh_mmcif_probe(struct platform_device *pdev) sh_mmcif_sync_reset(host); sh_mmcif_writel(host->addr, MMCIF_CE_INT_MASK, MASK_ALL); - ret = request_threaded_irq(irq[0], sh_mmcif_intr, sh_mmcif_irqt, 0, "sh_mmc:error", host); + name = irq[1] < 0 ? dev_name(&pdev->dev) : "sh_mmc:error"; + ret = request_threaded_irq(irq[0], sh_mmcif_intr, sh_mmcif_irqt, 0, name, host); if (ret) { - dev_err(&pdev->dev, "request_irq error (sh_mmc:error)\n"); + dev_err(&pdev->dev, "request_irq error (%s)\n", name); goto ereqirq0; } - ret = request_threaded_irq(irq[1], sh_mmcif_intr, sh_mmcif_irqt, 0, "sh_mmc:int", host); - if (ret) { - dev_err(&pdev->dev, "request_irq error (sh_mmc:int)\n"); - goto ereqirq1; + if (irq[1] >= 0) { + ret = request_threaded_irq(irq[1], sh_mmcif_intr, sh_mmcif_irqt, + 0, "sh_mmc:int", host); + if (ret) { + dev_err(&pdev->dev, "request_irq error (sh_mmc:int)\n"); + goto ereqirq1; + } } if (pd && pd->use_cd_gpio) { @@ -1408,7 +1413,8 @@ emmcaddh: if (pd && pd->use_cd_gpio) mmc_gpio_free_cd(mmc); erqcd: - free_irq(irq[1], host); + if (irq[1] >= 0) + free_irq(irq[1], host); ereqirq1: free_irq(irq[0], host); ereqirq0: @@ -1457,7 +1463,8 @@ static int sh_mmcif_remove(struct platform_device *pdev) irq[1] = platform_get_irq(pdev, 1); free_irq(irq[0], host); - free_irq(irq[1], host); + if (irq[1] >= 0) + free_irq(irq[1], host); platform_set_drvdata(pdev, NULL);