Skip to content

Commit b875b97

Browse files
committed
spi: Remove the use of dev_err_probe()
Merge series from Xichao Zhao <zhao.xichao@vivo.com>: 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.
2 parents c1dd310 + 27848c0 commit b875b97

8 files changed

Lines changed: 9 additions & 13 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);

drivers/spi/spi-amlogic-spisg.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -733,7 +733,7 @@ static int aml_spisg_probe(struct platform_device *pdev)
733733
else
734734
ctlr = spi_alloc_host(dev, sizeof(*spisg));
735735
if (!ctlr)
736-
return dev_err_probe(dev, -ENOMEM, "controller allocation failed\n");
736+
return -ENOMEM;
737737

738738
spisg = spi_controller_get_devdata(ctlr);
739739
spisg->controller = ctlr;

drivers/spi/spi-microchip-core-qspi.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -701,8 +701,7 @@ static int mchp_coreqspi_probe(struct platform_device *pdev)
701701

702702
ctlr = devm_spi_alloc_host(&pdev->dev, sizeof(*qspi));
703703
if (!ctlr)
704-
return dev_err_probe(&pdev->dev, -ENOMEM,
705-
"unable to allocate host for QSPI controller\n");
704+
return -ENOMEM;
706705

707706
qspi = spi_controller_get_devdata(ctlr);
708707
platform_set_drvdata(pdev, qspi);

drivers/spi/spi-microchip-core.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -534,8 +534,7 @@ static int mchp_corespi_probe(struct platform_device *pdev)
534534

535535
host = devm_spi_alloc_host(&pdev->dev, sizeof(*spi));
536536
if (!host)
537-
return dev_err_probe(&pdev->dev, -ENOMEM,
538-
"unable to allocate host for SPI controller\n");
537+
return -ENOMEM;
539538

540539
platform_set_drvdata(pdev, host);
541540

drivers/spi/spi-mt65xx.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1159,7 +1159,7 @@ static int mtk_spi_probe(struct platform_device *pdev)
11591159

11601160
host = devm_spi_alloc_host(dev, sizeof(*mdata));
11611161
if (!host)
1162-
return dev_err_probe(dev, -ENOMEM, "failed to alloc spi host\n");
1162+
return -ENOMEM;
11631163

11641164
host->auto_runtime_pm = true;
11651165
host->dev.of_node = dev->of_node;

drivers/spi/spi-pxa2xx.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1283,7 +1283,7 @@ int pxa2xx_spi_probe(struct device *dev, struct ssp_device *ssp,
12831283
else
12841284
controller = devm_spi_alloc_host(dev, sizeof(*drv_data));
12851285
if (!controller)
1286-
return dev_err_probe(dev, -ENOMEM, "cannot alloc spi_controller\n");
1286+
return -ENOMEM;
12871287

12881288
drv_data = spi_controller_get_devdata(controller);
12891289
drv_data->controller = controller;

drivers/spi/spi-s3c64xx.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1268,8 +1268,7 @@ static int s3c64xx_spi_probe(struct platform_device *pdev)
12681268

12691269
host = devm_spi_alloc_host(&pdev->dev, sizeof(*sdd));
12701270
if (!host)
1271-
return dev_err_probe(&pdev->dev, -ENOMEM,
1272-
"Unable to allocate SPI Host\n");
1271+
return -ENOMEM;
12731272

12741273
platform_set_drvdata(pdev, host);
12751274

0 commit comments

Comments
 (0)