[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4aa50389-ff14-4144-a07e-d1ef97449a89@intel.com>
Date: Mon, 9 Dec 2024 13:26:30 +0200
From: Adrian Hunter <adrian.hunter@...el.com>
To: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
Ulf Hansson <ulf.hansson@...aro.org>,
Victor Shih <victor.shih@...esyslogic.com.tw>, linux-mmc@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 4/6] mmc: sdhci-acpi: Use
devm_platform_ioremap_resource()
On 1/11/24 12:11, Andy Shevchenko wrote:
> The struct resource is not used for anything else, so we can simplify
> the code a bit by using the helper function.
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Acked-by: Adrian Hunter <adrian.hunter@...el.com>
> ---
> drivers/mmc/host/sdhci-acpi.c | 17 +++--------------
> 1 file changed, 3 insertions(+), 14 deletions(-)
>
> diff --git a/drivers/mmc/host/sdhci-acpi.c b/drivers/mmc/host/sdhci-acpi.c
> index f861e9a3a911..8e265b53d7ce 100644
> --- a/drivers/mmc/host/sdhci-acpi.c
> +++ b/drivers/mmc/host/sdhci-acpi.c
> @@ -822,8 +822,6 @@ static int sdhci_acpi_probe(struct platform_device *pdev)
> struct acpi_device *device;
> struct sdhci_acpi_host *c;
> struct sdhci_host *host;
> - struct resource *iomem;
> - resource_size_t len;
> size_t priv_size;
> int quirks = 0;
> int err;
> @@ -844,14 +842,6 @@ static int sdhci_acpi_probe(struct platform_device *pdev)
> if (sdhci_acpi_byt_defer(dev))
> return -EPROBE_DEFER;
>
> - iomem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> - if (!iomem)
> - return -ENOMEM;
> -
> - len = resource_size(iomem);
> - if (!devm_request_mem_region(dev, iomem->start, len, dev_name(dev)))
> - return -ENOMEM;
> -
> priv_size = slot ? slot->priv_size : 0;
> host = sdhci_alloc_host(dev, sizeof(struct sdhci_acpi_host) + priv_size);
> if (IS_ERR(host))
> @@ -873,10 +863,9 @@ static int sdhci_acpi_probe(struct platform_device *pdev)
> goto err_free;
> }
>
> - host->ioaddr = devm_ioremap(dev, iomem->start,
> - resource_size(iomem));
> - if (host->ioaddr == NULL) {
> - err = -ENOMEM;
> + host->ioaddr = devm_platform_ioremap_resource(pdev, 0);
> + if (IS_ERR(host->ioaddr)) {
> + err = PTR_ERR(host->ioaddr);
> goto err_free;
> }
>
Powered by blists - more mailing lists