Skip to content

Commit 274b345

Browse files
andy-shevbroonie
authored andcommitted
spi: microchip-core: Replace dead code (-ENOMEM error message)
First of all, the convention in the kernel that we do not issue error messages for -ENOMEM. Second, it's ignored by dev_err_probe(). Replace dead code by a simple return statement. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Prajna Rajendra Kumar <prajna.rajendrakumar@microchip.com> Link: https://patch.msgid.link/20251126075558.2035012-4-andriy.shevchenko@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent e29aca7 commit 274b345

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

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

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

306306
host = devm_spi_alloc_host(&pdev->dev, sizeof(*spi));
307307
if (!host)
308-
return dev_err_probe(&pdev->dev, -ENOMEM,
309-
"unable to allocate host for SPI controller\n");
308+
return -ENOMEM;
310309

311310
platform_set_drvdata(pdev, host);
312311

0 commit comments

Comments
 (0)