Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1378414 > unrolled thread

[PATCH 0/7] mmc: sdhci-pltfm: fix and tidy up sdhci_pltfm_init()

Started byMasahiro Yamada <yamada.masahiro@socionext.com>
First post2016-04-14 04:40 +0200
Last post2016-04-14 04:40 +0200
Articles 2 — 1 participant

Back to article view | Back to linux.kernel


Contents

  [PATCH 0/7] mmc: sdhci-pltfm: fix and tidy up sdhci_pltfm_init() Masahiro Yamada <yamada.masahiro@socionext.com> - 2016-04-14 04:40 +0200
    [PATCH 2/7] mmc: sdhci-pltfm: check return value of platform_get_irq() Masahiro Yamada <yamada.masahiro@socionext.com> - 2016-04-14 04:40 +0200

#1378414 — [PATCH 0/7] mmc: sdhci-pltfm: fix and tidy up sdhci_pltfm_init()

FromMasahiro Yamada <yamada.masahiro@socionext.com>
Date2016-04-14 04:40 +0200
Subject[PATCH 0/7] mmc: sdhci-pltfm: fix and tidy up sdhci_pltfm_init()
Message-ID<rnFcB-2RY-5@gated-at.bofh.it>


Masahiro Yamada (7):
  mmc: sdhci-pltfm: bail out if register resource is too small
  mmc: sdhci-pltfm: check return value of platform_get_irq()
  mmc: sdhci-pltfm: use devm_request_mem_region()
  mmc: sdhci-pltfm: use devm_ioremap()
  mmc: sdhci-pltfm: use devm_ioremap_resource()
  mmc: sdhci-pltfm: move devm_ioremap_resource() up
  mmc: sdhci-pltfm: call platform_get_irq() before sdhci_alloc_host()

 drivers/mmc/host/sdhci-pltfm.c | 46 +++++++++++++++++-------------------------
 1 file changed, 18 insertions(+), 28 deletions(-)

-- 
1.9.1

[toc] | [next] | [standalone]


#1378415 — [PATCH 2/7] mmc: sdhci-pltfm: check return value of platform_get_irq()

FromMasahiro Yamada <yamada.masahiro@socionext.com>
Date2016-04-14 04:40 +0200
Subject[PATCH 2/7] mmc: sdhci-pltfm: check return value of platform_get_irq()
Message-ID<rnFmi-2VI-13@gated-at.bofh.it>
In reply to#1378414
The function platform_get_irq() can fail; it returns a negative error
code on error.  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 <yamada.masahiro@socionext.com>
---

 drivers/mmc/host/sdhci-pltfm.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/mmc/host/sdhci-pltfm.c b/drivers/mmc/host/sdhci-pltfm.c
index 7d12203..3354a53 100644
--- a/drivers/mmc/host/sdhci-pltfm.c
+++ b/drivers/mmc/host/sdhci-pltfm.c
@@ -152,6 +152,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");
+		ret = host->irq;
+		goto err_request;
+	}
 
 	if (!request_mem_region(iomem->start, resource_size(iomem),
 		mmc_hostname(host->mmc))) {
-- 
1.9.1

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web