Skip to content

Commit 2aade32

Browse files
Xichao Zhaobroonie
authored andcommitted
spi: 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-4-zhao.xichao@vivo.com Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent 0d00ebc commit 2aade32

2 files changed

Lines changed: 2 additions & 4 deletions

File tree

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

0 commit comments

Comments
 (0)