Re: [PATCH 4/5] spi: cadence-xspi: Rework resource discovery

From: Mark Brown

Date: Sat Nov 07 2026 - 07:09:22 EST


> The previous code worked, but calling
> devm_platform_ioremap_resource_byname() on ACPI where resources aren't
> named causes warnings to be printed, one per call:
>

> cdns_xspi->sdmabase = devm_ioremap_resource(dev, res);
> if (IS_ERR(cdns_xspi->sdmabase)) {
> - res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
> - cdns_xspi->sdmabase = devm_ioremap_resource(dev, res);
> - if (IS_ERR(cdns_xspi->sdmabase))
> - return PTR_ERR(cdns_xspi->sdmabase);
> + dev_err(dev, "Failed to remap sdma address\n");

devm_ioremap_reource() already logs.

> if (cdns_xspi->driver_data->mrvl_hw_overlay) {
> - cdns_xspi->xferbase = devm_platform_ioremap_resource_byname(pdev, "xfer");
> + res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "xfer");
> + if (!res)
> + res = platform_get_resource(pdev, IORESOURCE_MEM, 3);
> +
> + cdns_xspi->xferbase = devm_ioremap_resource(dev, res);

This will still do the warning log if the lookups fail on Marvell.

--
Mark Brown <broonie@xxxxxxxxxx>