summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXichao Zhao <zhao.xichao@vivo.com>2025-08-19 17:20:38 +0800
committerMark Brown <broonie@kernel.org>2025-08-19 13:05:58 +0100
commit2a5d410916d3a8dcac06f72494f252314e933cfb (patch)
tree530a0d3364c44e18921cb562f0ac3dee1b1734e8
parentc17b750b3ad9f45f2b6f7e6f7f4679844244f0b9 (diff)
spi: spi_amd: Remove the use of dev_err_probe()
The dev_err_probe() doesn't do anything when error is '-ENOMEM'. Therefore, remove the useless call to dev_err_probe(), and just return the value instead. Signed-off-by: Xichao Zhao <zhao.xichao@vivo.com> Link: https://patch.msgid.link/20250819092044.549464-2-zhao.xichao@vivo.com Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r--drivers/spi/spi-amd-pci.c5
-rw-r--r--drivers/spi/spi-amd.c2
2 files changed, 3 insertions, 4 deletions
diff --git a/drivers/spi/spi-amd-pci.c b/drivers/spi/spi-amd-pci.c
index e5faab414c17..d48c3a5da303 100644
--- a/drivers/spi/spi-amd-pci.c
+++ b/drivers/spi/spi-amd-pci.c
@@ -38,7 +38,7 @@ static int amd_spi_pci_probe(struct pci_dev *pdev,
/* Allocate storage for host and driver private data */
host = devm_spi_alloc_host(dev, sizeof(struct amd_spi));
if (!host)
- return dev_err_probe(dev, -ENOMEM, "Error allocating SPI host\n");
+ return -ENOMEM;
amd_spi = spi_controller_get_devdata(host);
@@ -47,8 +47,7 @@ static int amd_spi_pci_probe(struct pci_dev *pdev,
amd_spi->io_remap_addr = devm_ioremap(dev, io_base_addr, AMD_HID2_MEM_SIZE);
if (!amd_spi->io_remap_addr)
- return dev_err_probe(dev, -ENOMEM,
- "ioremap of SPI registers failed\n");
+ return -ENOMEM;
dev_dbg(dev, "io_remap_address: %p\n", amd_spi->io_remap_addr);
diff --git a/drivers/spi/spi-amd.c b/drivers/spi/spi-amd.c
index 02e7fe095a0b..4d1dce4f4974 100644
--- a/drivers/spi/spi-amd.c
+++ b/drivers/spi/spi-amd.c
@@ -857,7 +857,7 @@ static int amd_spi_probe(struct platform_device *pdev)
/* Allocate storage for host and driver private data */
host = devm_spi_alloc_host(dev, sizeof(struct amd_spi));
if (!host)
- return dev_err_probe(dev, -ENOMEM, "Error allocating SPI host\n");
+ return -ENOMEM;
amd_spi = spi_controller_get_devdata(host);
amd_spi->io_remap_addr = devm_platform_ioremap_resource(pdev, 0);