All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
To: Ulf Hansson <ulf.hansson@linaro.org>, Simon <horms@verge.net.au>
Cc: linux-mmc <linux-mmc@vger.kernel.org>,
	Magnus <magnus.damm@gmail.com>,
	Linux-SH <linux-sh@vger.kernel.org>,
	Laurent <laurent.pinchart@ideasonboard.com>,
	kobayashi <keita.kobayashi.ym@renesas.com>
Subject: [PATCH 2/7 v4] mmc: sh_mmcif: cleanup to use dev instead of &pdev->dev
Date: Thu, 23 Apr 2015 08:14:12 +0000	[thread overview]
Message-ID: <878udjgt4i.wl%kuninori.morimoto.gx@renesas.com> (raw)
In-Reply-To: <87d22vgt8u.wl%kuninori.morimoto.gx@renesas.com>

From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tested-by: Keita Kobayashi <keita.kobayashi.ym@renesas.com>
Acked-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
v3 -> v4

 - no change

 drivers/mmc/host/sh_mmcif.c | 33 +++++++++++++++++----------------
 1 file changed, 17 insertions(+), 16 deletions(-)

diff --git a/drivers/mmc/host/sh_mmcif.c b/drivers/mmc/host/sh_mmcif.c
index 4e81278..5282c5b 100644
--- a/drivers/mmc/host/sh_mmcif.c
+++ b/drivers/mmc/host/sh_mmcif.c
@@ -1386,7 +1386,8 @@ static int sh_mmcif_probe(struct platform_device *pdev)
 	int ret = 0, irq[2];
 	struct mmc_host *mmc;
 	struct sh_mmcif_host *host;
-	struct sh_mmcif_plat_data *pd = pdev->dev.platform_data;
+	struct device *dev = &pdev->dev;
+	struct sh_mmcif_plat_data *pd = dev->platform_data;
 	struct resource *res;
 	void __iomem *reg;
 	const char *name;
@@ -1394,16 +1395,16 @@ static int sh_mmcif_probe(struct platform_device *pdev)
 	irq[0] = platform_get_irq(pdev, 0);
 	irq[1] = platform_get_irq(pdev, 1);
 	if (irq[0] < 0) {
-		dev_err(&pdev->dev, "Get irq error\n");
+		dev_err(dev, "Get irq error\n");
 		return -ENXIO;
 	}
 
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	reg = devm_ioremap_resource(&pdev->dev, res);
+	reg = devm_ioremap_resource(dev, res);
 	if (IS_ERR(reg))
 		return PTR_ERR(reg);
 
-	mmc = mmc_alloc_host(sizeof(struct sh_mmcif_host), &pdev->dev);
+	mmc = mmc_alloc_host(sizeof(struct sh_mmcif_host), dev);
 	if (!mmc)
 		return -ENOMEM;
 
@@ -1436,20 +1437,20 @@ static int sh_mmcif_probe(struct platform_device *pdev)
 
 	platform_set_drvdata(pdev, host);
 
-	pm_runtime_enable(&pdev->dev);
+	pm_runtime_enable(dev);
 	host->power = false;
 
-	host->hclk = devm_clk_get(&pdev->dev, NULL);
+	host->hclk = devm_clk_get(dev, NULL);
 	if (IS_ERR(host->hclk)) {
 		ret = PTR_ERR(host->hclk);
-		dev_err(&pdev->dev, "cannot get clock: %d\n", ret);
+		dev_err(dev, "cannot get clock: %d\n", ret);
 		goto err_pm;
 	}
 	ret = sh_mmcif_clk_update(host);
 	if (ret < 0)
 		goto err_pm;
 
-	ret = pm_runtime_resume(&pdev->dev);
+	ret = pm_runtime_resume(dev);
 	if (ret < 0)
 		goto err_clk;
 
@@ -1458,19 +1459,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);
 
-	name = irq[1] < 0 ? dev_name(&pdev->dev) : "sh_mmc:error";
-	ret = devm_request_threaded_irq(&pdev->dev, irq[0], sh_mmcif_intr,
+	name = irq[1] < 0 ? dev_name(dev) : "sh_mmc:error";
+	ret = devm_request_threaded_irq(dev, irq[0], sh_mmcif_intr,
 					sh_mmcif_irqt, 0, name, host);
 	if (ret) {
-		dev_err(&pdev->dev, "request_irq error (%s)\n", name);
+		dev_err(dev, "request_irq error (%s)\n", name);
 		goto err_clk;
 	}
 	if (irq[1] >= 0) {
-		ret = devm_request_threaded_irq(&pdev->dev, irq[1],
+		ret = devm_request_threaded_irq(dev, 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");
+			dev_err(dev, "request_irq error (sh_mmc:int)\n");
 			goto err_clk;
 		}
 	}
@@ -1487,9 +1488,9 @@ static int sh_mmcif_probe(struct platform_device *pdev)
 	if (ret < 0)
 		goto err_clk;
 
-	dev_pm_qos_expose_latency_limit(&pdev->dev, 100);
+	dev_pm_qos_expose_latency_limit(dev, 100);
 
-	dev_info(&pdev->dev, "Chip version 0x%04x, clock rate %luMHz\n",
+	dev_info(dev, "Chip version 0x%04x, clock rate %luMHz\n",
 		 sh_mmcif_readl(host->addr, MMCIF_CE_VERSION) & 0xffff,
 		 clk_get_rate(host->hclk) / 1000000UL);
 
@@ -1499,7 +1500,7 @@ static int sh_mmcif_probe(struct platform_device *pdev)
 err_clk:
 	clk_disable_unprepare(host->hclk);
 err_pm:
-	pm_runtime_disable(&pdev->dev);
+	pm_runtime_disable(dev);
 err_host:
 	mmc_free_host(mmc);
 	return ret;
-- 
1.9.1


  parent reply	other threads:[~2015-04-23  8:14 UTC|newest]

Thread overview: 95+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <873840a4ch.wl%kuninori.morimoto.gx@renesas.com>
2015-04-21  3:49 ` mmc: sh_mmcif: add PLL support Kuninori Morimoto
2015-04-21  3:50   ` [PATCH 1/3] mmc: sh_mmcif: move mmcif_of_match to upside Kuninori Morimoto
2015-04-21  3:50   ` [PATCH 2/3] mmc: sh_mmcif: cleanup to use dev instead of &pdev->dev Kuninori Morimoto
2015-04-21  3:51   ` [PATCH 3/3] mmc: sh_mmcif: calculate best clock with PLL Kuninori Morimoto
2015-04-21  7:43     ` Kuninori Morimoto
2015-04-21  7:51       ` Laurent Pinchart
2015-04-21  7:58         ` Kuninori Morimoto
2015-04-21  7:53 ` [PATCH 0/3 v2] mmc: sh_mmcif: add PLL support Kuninori Morimoto
2015-04-21  7:54   ` [PATCH 1/3 v2] mmc: sh_mmcif: move mmcif_of_match to upside Kuninori Morimoto
2015-04-21  7:54   ` [PATCH 2/3 v2] mmc: sh_mmcif: cleanup to use dev instead of &pdev->dev Kuninori Morimoto
2015-04-21  7:55   ` [PATCH 3/3 v2] mmc: sh_mmcif: calculate best clock with parent clock Kuninori Morimoto
2015-04-21  8:23   ` [PATCH 0/3 v2] mmc: sh_mmcif: add PLL support Kuninori Morimoto
2015-04-21  8:26 ` [PATCH 0/3 v3] " Kuninori Morimoto
2015-04-21  8:26   ` [PATCH 1/3 v3] mmc: sh_mmcif: move mmcif_of_match to upside Kuninori Morimoto
2015-04-21 10:07     ` Geert Uytterhoeven
2015-04-21 10:07       ` Geert Uytterhoeven
2015-04-21  8:27   ` [PATCH 2/3 v3] mmc: sh_mmcif: cleanup to use dev instead of &pdev->dev Kuninori Morimoto
2015-04-21 10:07     ` Geert Uytterhoeven
2015-04-21 10:07       ` Geert Uytterhoeven
2015-04-21  8:31   ` [PATCH 3/3 v3] mmc: sh_mmcif: calculate best clock with parent clock Kuninori Morimoto
2015-04-21  8:31     ` Kuninori Morimoto
2015-04-21 10:31     ` Geert Uytterhoeven
2015-04-21 10:31       ` Geert Uytterhoeven
2015-04-21 13:07       ` Laurent Pinchart
2015-04-21 13:07         ` Laurent Pinchart
2015-04-22  1:05         ` Kuninori Morimoto
2015-05-04  1:04           ` Laurent Pinchart
2015-05-04  1:04             ` Laurent Pinchart
2015-05-11  2:15             ` Kuninori Morimoto
2015-05-11  2:15               ` Kuninori Morimoto
2015-04-22  1:04       ` Kuninori Morimoto
2015-04-22  7:49         ` Geert Uytterhoeven
2015-04-22  7:49           ` Geert Uytterhoeven
2015-04-22  8:18           ` Ulf Hansson
2015-04-22  8:18             ` Ulf Hansson
2015-04-22  8:22             ` Geert Uytterhoeven
2015-04-22  8:22               ` Geert Uytterhoeven
2015-04-22  9:16               ` Kuninori Morimoto
2015-04-23  8:11 ` [PATCH 0/7 v4] mmc: sh_mmcif: add parent clk support Kuninori Morimoto
2015-04-23  8:13   ` [PATCH 1/7 v4] mmc: sh_mmcif: move mmcif_of_match to upside Kuninori Morimoto
2015-04-23  8:14   ` Kuninori Morimoto [this message]
2015-04-23  8:15   ` [PATCH 3/7 v4] mmc: sh_mmcif: remove unnecessary int clk from struct sh_mmcif_host Kuninori Morimoto
2015-04-23  8:15     ` Kuninori Morimoto
2015-04-23 10:01     ` Geert Uytterhoeven
2015-04-23 10:01       ` Geert Uytterhoeven
2015-04-23  8:16   ` [PATCH 4/7 v4] mmc: sh_mmcif: separate sh_mmcif_clk_update() into setup and prepare Kuninori Morimoto
2015-04-23 10:00     ` Geert Uytterhoeven
2015-04-23 10:00       ` Geert Uytterhoeven
2015-04-23  8:17   ` [PATCH 5/7 v4] mmc: sh_mmcif: calculate best clock with parent clock Kuninori Morimoto
2015-04-23  8:17     ` Kuninori Morimoto
2015-05-12 10:22     ` Laurent Pinchart
2015-05-12 10:22       ` Laurent Pinchart
2015-05-13  0:08       ` Kuninori Morimoto
2015-04-23  8:18   ` [PATCH 6/7 v4] ARM: shmobile: r8a7790: add MMCIF parent clock range Kuninori Morimoto
2015-05-07  5:26     ` Simon Horman
2015-05-07  5:26       ` Simon Horman
2015-05-11  2:53       ` Kuninori Morimoto
2015-05-11  5:39         ` Simon Horman
2015-05-11  5:39           ` Simon Horman
2015-04-23  8:18   ` [PATCH 7/7 v4] ARM: shmobile: r8a7791: " Kuninori Morimoto
2015-04-23 10:07   ` [PATCH 0/7 v4] mmc: sh_mmcif: add parent clk support Laurent Pinchart
2015-04-23 10:07     ` Laurent Pinchart
2015-05-05  8:33     ` Ulf Hansson
2015-05-05  8:33       ` Ulf Hansson
2015-05-13  2:16 ` [PATCH 0/3 v5] " Kuninori Morimoto
2015-05-13  2:17   ` [PATCH 1/3 v5] mmc: sh_mmcif: add sh_mmcif_host_to_dev() macro and use it Kuninori Morimoto
2015-05-13  2:17     ` Kuninori Morimoto
2015-05-13  2:18   ` [PATCH 2/3 v5] mmc: sh_mmcif: use sh_mmcif_xxx prefix for all functions Kuninori Morimoto
2015-05-13  2:18   ` [PATCH 3/3 v5] mmc: sh_mmcif: calculate best clock with parent clock Kuninori Morimoto
2015-05-13  2:18     ` Kuninori Morimoto
2015-05-13  7:55     ` Geert Uytterhoeven
2015-05-13  7:55       ` Geert Uytterhoeven
2015-05-13  8:37       ` Kuninori Morimoto
2015-05-13  8:43         ` Geert Uytterhoeven
2015-05-13  8:43           ` Geert Uytterhoeven
2015-05-13  9:27           ` Kuninori Morimoto
2015-05-14  7:20 ` [PATCH 0/3 v6] mmc: sh_mmcif: add parent clk support Kuninori Morimoto
2015-05-14  7:21   ` [PATCH 1/5 v6] mmc: sh_mmcif: add sh_mmcif_host_to_dev() macro and use it Kuninori Morimoto
2015-05-14  7:21     ` Kuninori Morimoto
2015-05-14  7:21   ` [PATCH 2/5 v6] mmc: sh_mmcif: use sh_mmcif_xxx prefix for all functions Kuninori Morimoto
2015-05-14  7:22   ` [PATCH 3/5 v6] mmc: sh_mmcif: calculate best clock with parent clock Kuninori Morimoto
2015-05-14  7:22     ` Kuninori Morimoto
2015-05-14  7:23   ` [PATCH 4/5 v6] ARM: shmobile: r8a7790: add MMCIF max-frequency Kuninori Morimoto
2015-05-14  7:23   ` [PATCH 5/5 v6] ARM: shmobile: r8a7791: " Kuninori Morimoto
2015-05-22 14:01   ` [PATCH 0/3 v6] mmc: sh_mmcif: add parent clk support Ulf Hansson
2015-05-22 14:01     ` Ulf Hansson
2015-05-25  0:24     ` Kuninori Morimoto
2015-05-25  0:50       ` Simon Horman
2015-05-25  0:50         ` Simon Horman
2015-05-25  0:26     ` Simon Horman
2015-05-25  0:26       ` Simon Horman
2015-05-25  0:38       ` Kuninori Morimoto
2015-05-25  8:44     ` Ulf Hansson
2015-05-25  8:44       ` Ulf Hansson
2015-05-25  9:38       ` Kuninori Morimoto

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=878udjgt4i.wl%kuninori.morimoto.gx@renesas.com \
    --to=kuninori.morimoto.gx@renesas.com \
    --cc=horms@verge.net.au \
    --cc=keita.kobayashi.ym@renesas.com \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-mmc@vger.kernel.org \
    --cc=linux-sh@vger.kernel.org \
    --cc=magnus.damm@gmail.com \
    --cc=ulf.hansson@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.