Skip to content

Commit 2a5d410

Browse files
Xichao Zhaobroonie
authored andcommitted
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>
1 parent c17b750 commit 2a5d410

2 files changed

Lines changed: 3 additions & 4 deletions

File tree

drivers/spi/spi-amd-pci.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ static int amd_spi_pci_probe(struct pci_dev *pdev,
3838
/* Allocate storage for host and driver private data */
3939
host = devm_spi_alloc_host(dev, sizeof(struct amd_spi));
4040
if (!host)
41-
return dev_err_probe(dev, -ENOMEM, "Error allocating SPI host\n");
41+
return -ENOMEM;
4242

4343
amd_spi = spi_controller_get_devdata(host);
4444

@@ -47,8 +47,7 @@ static int amd_spi_pci_probe(struct pci_dev *pdev,
4747
amd_spi->io_remap_addr = devm_ioremap(dev, io_base_addr, AMD_HID2_MEM_SIZE);
4848

4949
if (!amd_spi->io_remap_addr)
50-
return dev_err_probe(dev, -ENOMEM,
51-
"ioremap of SPI registers failed\n");
50+
return -ENOMEM;
5251

5352
dev_dbg(dev, "io_remap_address: %p\n", amd_spi->io_remap_addr);
5453

drivers/spi/spi-amd.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -857,7 +857,7 @@ static int amd_spi_probe(struct platform_device *pdev)
857857
/* Allocate storage for host and driver private data */
858858
host = devm_spi_alloc_host(dev, sizeof(struct amd_spi));
859859
if (!host)
860-
return dev_err_probe(dev, -ENOMEM, "Error allocating SPI host\n");
860+
return -ENOMEM;
861861

862862
amd_spi = spi_controller_get_devdata(host);
863863
amd_spi->io_remap_addr = devm_platform_ioremap_resource(pdev, 0);

0 commit comments

Comments
 (0)