Skip to content

Commit 58d8a90

Browse files
committed
mmc: sdhci-brcmstb: silence noise when boot_regs absent
devm_platform_get_and_ioremap_resource() prints sdhci-brcmstb 1001100000.mmc: error -EINVAL: invalid resource (null) whenever the optional 'boot_regs' resource (index 2) isn't present. Pi 5 sdio2 (WLAN) declares only 'host'+'cfg' so this fires every boot even though the driver intentionally treats the missing resource as non-fatal. Use platform_get_resource() to probe for the resource first and only ioremap when it exists.
1 parent 9d267d7 commit 58d8a90

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

drivers/mmc/host/sdhci-brcmstb.c

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -633,9 +633,14 @@ static int sdhci_brcmstb_probe(struct platform_device *pdev)
633633

634634
/* map non-standard BOOT registers if present */
635635
if (host->mmc->caps & MMC_CAP_NONREMOVABLE) {
636-
priv->boot_regs = devm_platform_get_and_ioremap_resource(pdev, 2, NULL);
637-
if (IS_ERR(priv->boot_regs))
638-
priv->boot_regs = NULL;
636+
struct resource *boot_res;
637+
638+
boot_res = platform_get_resource(pdev, IORESOURCE_MEM, 2);
639+
if (boot_res) {
640+
priv->boot_regs = devm_ioremap_resource(&pdev->dev, boot_res);
641+
if (IS_ERR(priv->boot_regs))
642+
priv->boot_regs = NULL;
643+
}
639644
}
640645

641646
/*

0 commit comments

Comments
 (0)