]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
spi: hisi-kunpeng: Use dev_err_probe() for host registration failure
authorQiang Ma <maqianga@uniontech.com>
Fri, 15 May 2026 10:26:20 +0000 (18:26 +0800)
committerMark Brown <broonie@kernel.org>
Fri, 15 May 2026 13:42:42 +0000 (22:42 +0900)
When the SPI core registers the Kunpeng controller it may need to acquire
chip-select GPIO descriptors. If the GPIO provider has not probed yet,
spi_register_controller() returns -EPROBE_DEFER.

On a Kunpeng system this currently prints an alarming error even though the
next deferred-probe retry succeeds:

  hisi-kunpeng-spi HISI03E1:00: failed to register spi host, ret=-517
  hisi-kunpeng-spi HISI03E1:00: hw version:0x30 max-freq:12500 kHz

Use dev_err_probe() so that -EPROBE_DEFER is reported through the deferred
probe mechanism instead of as a hard error, while preserving normal error
reporting for real registration failures.

Fixes: c770d8631e18 ("spi: Add HiSilicon SPI Controller Driver for Kunpeng SoCs")
Signed-off-by: Qiang Ma <maqianga@uniontech.com>
Link: https://patch.msgid.link/20260515102620.1926930-1-maqianga@uniontech.com
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi-hisi-kunpeng.c

index 046bd894040b10a58c72bd9d4c298106bc0a66ec..395214b81179ec4619dec3004045e63c464228e5 100644 (file)
@@ -520,10 +520,8 @@ static int hisi_spi_probe(struct platform_device *pdev)
        }
 
        ret = spi_register_controller(host);
-       if (ret) {
-               dev_err(dev, "failed to register spi host, ret=%d\n", ret);
-               return ret;
-       }
+       if (ret)
+               return dev_err_probe(dev, ret, "failed to register spi host\n");
 
        if (hisi_spi_debugfs_init(hs))
                dev_info(dev, "failed to create debugfs dir\n");