public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mmc: sdhci-pltfm: Use devm_platform_ioremap_resource() to simplify code
@ 2019-07-25  7:28 Jisheng Zhang
  2019-07-25 13:14 ` Ulf Hansson
  0 siblings, 1 reply; 2+ messages in thread
From: Jisheng Zhang @ 2019-07-25  7:28 UTC (permalink / raw)
  To: Adrian Hunter, Ulf Hansson
  Cc: linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org

devm_platform_ioremap_resource() wraps platform_get_resource() and
devm_ioremap_resource() in a single helper, let's use that helper to
simplify the code.

Signed-off-by: Jisheng Zhang <Jisheng.Zhang@synaptics.com>
---
 drivers/mmc/host/sdhci-pltfm.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/mmc/host/sdhci-pltfm.c b/drivers/mmc/host/sdhci-pltfm.c
index d268b3b8850a..11ecff9e998d 100644
--- a/drivers/mmc/host/sdhci-pltfm.c
+++ b/drivers/mmc/host/sdhci-pltfm.c
@@ -118,12 +118,10 @@ struct sdhci_host *sdhci_pltfm_init(struct platform_device *pdev,
 				    size_t priv_size)
 {
 	struct sdhci_host *host;
-	struct resource *iomem;
 	void __iomem *ioaddr;
 	int irq, ret;
 
-	iomem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	ioaddr = devm_ioremap_resource(&pdev->dev, iomem);
+	ioaddr = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(ioaddr)) {
 		ret = PTR_ERR(ioaddr);
 		goto err;
-- 
2.22.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] mmc: sdhci-pltfm: Use devm_platform_ioremap_resource() to simplify code
  2019-07-25  7:28 [PATCH] mmc: sdhci-pltfm: Use devm_platform_ioremap_resource() to simplify code Jisheng Zhang
@ 2019-07-25 13:14 ` Ulf Hansson
  0 siblings, 0 replies; 2+ messages in thread
From: Ulf Hansson @ 2019-07-25 13:14 UTC (permalink / raw)
  To: Jisheng Zhang
  Cc: Adrian Hunter, linux-mmc@vger.kernel.org,
	linux-kernel@vger.kernel.org

On Thu, 25 Jul 2019 at 09:28, Jisheng Zhang <Jisheng.Zhang@synaptics.com> wrote:
>
> devm_platform_ioremap_resource() wraps platform_get_resource() and
> devm_ioremap_resource() in a single helper, let's use that helper to
> simplify the code.
>
> Signed-off-by: Jisheng Zhang <Jisheng.Zhang@synaptics.com>

Applied for next, thanks!

Kind regards
Uffe


> ---
>  drivers/mmc/host/sdhci-pltfm.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/drivers/mmc/host/sdhci-pltfm.c b/drivers/mmc/host/sdhci-pltfm.c
> index d268b3b8850a..11ecff9e998d 100644
> --- a/drivers/mmc/host/sdhci-pltfm.c
> +++ b/drivers/mmc/host/sdhci-pltfm.c
> @@ -118,12 +118,10 @@ struct sdhci_host *sdhci_pltfm_init(struct platform_device *pdev,
>                                     size_t priv_size)
>  {
>         struct sdhci_host *host;
> -       struct resource *iomem;
>         void __iomem *ioaddr;
>         int irq, ret;
>
> -       iomem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> -       ioaddr = devm_ioremap_resource(&pdev->dev, iomem);
> +       ioaddr = devm_platform_ioremap_resource(pdev, 0);
>         if (IS_ERR(ioaddr)) {
>                 ret = PTR_ERR(ioaddr);
>                 goto err;
> --
> 2.22.0
>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-07-25 13:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-07-25  7:28 [PATCH] mmc: sdhci-pltfm: Use devm_platform_ioremap_resource() to simplify code Jisheng Zhang
2019-07-25 13:14 ` Ulf Hansson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox