Skip to content

Commit ecfe492

Browse files
andy-shevstorulf
authored andcommitted
mmc: sdhci-acpi: Use devm_platform_ioremap_resource()
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@linux.intel.com> Acked-by: Adrian Hunter <adrian.hunter@intel.com> Message-ID: <20241101101441.3518612-5-andriy.shevchenko@linux.intel.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
1 parent 88e3008 commit ecfe492

File tree

1 file changed

+3
-14
lines changed

1 file changed

+3
-14
lines changed

drivers/mmc/host/sdhci-acpi.c

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -822,8 +822,6 @@ static int sdhci_acpi_probe(struct platform_device *pdev)
822822
struct acpi_device *device;
823823
struct sdhci_acpi_host *c;
824824
struct sdhci_host *host;
825-
struct resource *iomem;
826-
resource_size_t len;
827825
size_t priv_size;
828826
int quirks = 0;
829827
int err;
@@ -844,14 +842,6 @@ static int sdhci_acpi_probe(struct platform_device *pdev)
844842
if (sdhci_acpi_byt_defer(dev))
845843
return -EPROBE_DEFER;
846844

847-
iomem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
848-
if (!iomem)
849-
return -ENOMEM;
850-
851-
len = resource_size(iomem);
852-
if (!devm_request_mem_region(dev, iomem->start, len, dev_name(dev)))
853-
return -ENOMEM;
854-
855845
priv_size = slot ? slot->priv_size : 0;
856846
host = sdhci_alloc_host(dev, sizeof(struct sdhci_acpi_host) + priv_size);
857847
if (IS_ERR(host))
@@ -873,10 +863,9 @@ static int sdhci_acpi_probe(struct platform_device *pdev)
873863
goto err_free;
874864
}
875865

876-
host->ioaddr = devm_ioremap(dev, iomem->start,
877-
resource_size(iomem));
878-
if (host->ioaddr == NULL) {
879-
err = -ENOMEM;
866+
host->ioaddr = devm_platform_ioremap_resource(pdev, 0);
867+
if (IS_ERR(host->ioaddr)) {
868+
err = PTR_ERR(host->ioaddr);
880869
goto err_free;
881870
}
882871

0 commit comments

Comments
 (0)