From patchwork Wed Apr 20 02:16:26 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 66157 Delivered-To: patch@linaro.org Received: by 10.140.93.198 with SMTP id d64csp2195086qge; Tue, 19 Apr 2016 19:15:59 -0700 (PDT) X-Received: by 10.67.2.41 with SMTP id bl9mr8649679pad.39.1461118558752; Tue, 19 Apr 2016 19:15:58 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k4si897322pan.85.2016.04.19.19.15.58; Tue, 19 Apr 2016 19:15:58 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-mmc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@nifty.com; spf=pass (google.com: best guess record for domain of linux-mmc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-mmc-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752362AbcDTCP4 (ORCPT + 2 others); Tue, 19 Apr 2016 22:15:56 -0400 Received: from conuserg-11.nifty.com ([210.131.2.78]:38194 "EHLO conuserg-11.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751751AbcDTCP4 (ORCPT ); Tue, 19 Apr 2016 22:15:56 -0400 Received: from beagle.diag.org (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-11.nifty.com with ESMTP id u3K2FZ7g005192; Wed, 20 Apr 2016 11:15:37 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-11.nifty.com u3K2FZ7g005192 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1461118538; bh=epFa7/PagYuYucEYo2WnMpXDl5p+WO/SfTeNHoh48l8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=AjL4c7uzXkvx/kXyBNXXZ97MZPd++FdcbSUq/WugZk0b/3NNT4k3NUlSgLzQLCTTP ovbDAXWwr7kYtUgFVX+SAMz6Lz4hange4jjWtR0dpMcehS1SELJ72btyTCqAV4hhdk ennq4sBON0MMBRjcEtQzJuTvrOUHiNufrD66WOKDdEByBM59YP9UZv9u4znbLey5Aj Vt+OXwEgdmhGwJgkDNgVrEzZiT/darzSQ5jepbHglpWYkZhfYH9InljYNZjWA8mfnm jrea4Emfpbuxla2+Rj1yAGd753SZdEGNxfWrd7Vvg8gZ+qwMBn5VA5aE/78QJ48pTv k09EcD56bajVQ== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-mmc@vger.kernel.org Cc: Masahiro Yamada , linux-kernel@vger.kernel.org, Adrian Hunter , Ulf Hansson Subject: [PATCH v2 2/7] mmc: sdhci-pltfm: check return value of platform_get_irq() Date: Wed, 20 Apr 2016 11:16:26 +0900 Message-Id: <1461118591-21595-3-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1461118591-21595-1-git-send-email-yamada.masahiro@socionext.com> References: <1461118591-21595-1-git-send-email-yamada.masahiro@socionext.com> Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org The function platform_get_irq() can fail; it returns a negative error code on failure. A negative IRQ number will make sdhci_add_host() fail to request IRQ anyway, but it makes sense to let it fail earlier here. Signed-off-by: Masahiro Yamada --- Changes in v2: - Add \n to the tail of the error message drivers/mmc/host/sdhci-pltfm.c | 5 +++++ 1 file changed, 5 insertions(+) -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-mmc" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/mmc/host/sdhci-pltfm.c b/drivers/mmc/host/sdhci-pltfm.c index 03dbdeb..24377a3 100644 --- a/drivers/mmc/host/sdhci-pltfm.c +++ b/drivers/mmc/host/sdhci-pltfm.c @@ -146,6 +146,11 @@ struct sdhci_host *sdhci_pltfm_init(struct platform_device *pdev, } host->irq = platform_get_irq(pdev, 0); + if (host->irq < 0) { + dev_err(&pdev->dev, "failed to get IRQ number\n"); + ret = host->irq; + goto err_request; + } if (!request_mem_region(iomem->start, resource_size(iomem), mmc_hostname(host->mmc))) {