All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Prajna Rajendra Kumar <prajna.rajendrakumar@microchip.com>,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: Mark Brown <broonie@kernel.org>
Subject: [PATCH v3 3/6] spi: microchip-core: Replace dead code (-ENOMEM error message)
Date: Thu, 27 Nov 2025 19:59:00 +0100	[thread overview]
Message-ID: <20251127190031.2998705-4-andriy.shevchenko@linux.intel.com> (raw)
In-Reply-To: <20251127190031.2998705-1-andriy.shevchenko@linux.intel.com>

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.

Reviewed-by: Prajna Rajendra Kumar <prajna.rajendrakumar@microchip.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/spi/spi-microchip-core-spi.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/spi/spi-microchip-core-spi.c b/drivers/spi/spi-microchip-core-spi.c
index 439745a36f9c..fa6fb2d3f7d0 100644
--- a/drivers/spi/spi-microchip-core-spi.c
+++ b/drivers/spi/spi-microchip-core-spi.c
@@ -298,8 +298,7 @@ static int mchp_corespi_probe(struct platform_device *pdev)
 
 	host = devm_spi_alloc_host(&pdev->dev, sizeof(*spi));
 	if (!host)
-		return dev_err_probe(&pdev->dev, -ENOMEM,
-				     "unable to allocate host for SPI controller\n");
+		return -ENOMEM;
 
 	platform_set_drvdata(pdev, host);
 
-- 
2.50.1


  parent reply	other threads:[~2025-11-27 19:00 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-27 18:58 [PATCH v3 0/6] spi: microchip-core: Code improvements Andy Shevchenko
2025-11-27 18:58 ` [PATCH v3 1/6] spi: microchip-core: use min() instead of min_t() Andy Shevchenko
2025-11-27 18:58 ` [PATCH v3 2/6] spi: microchip-core: Refactor FIFO read and write handlers Andy Shevchenko
2025-11-28 14:16   ` Prajna.Rajendrakumar
2025-11-28 15:39     ` Andy Shevchenko
2025-11-28 15:54       ` Prajna.Rajendrakumar
2025-11-27 18:59 ` Andy Shevchenko [this message]
2025-11-27 18:59 ` [PATCH v3 4/6] spi: microchip-core: Utilise temporary variable for struct device Andy Shevchenko
2025-11-27 18:59 ` [PATCH v3 5/6] spi: microchip-core: Use SPI_MODE_X_MASK Andy Shevchenko
2025-11-27 18:59 ` [PATCH v3 6/6] spi: microchip-core: Remove unneeded PM related macro Andy Shevchenko
2025-11-28 21:35 ` [PATCH v3 0/6] spi: microchip-core: Code improvements Mark Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20251127190031.2998705-4-andriy.shevchenko@linux.intel.com \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=broonie@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-spi@vger.kernel.org \
    --cc=prajna.rajendrakumar@microchip.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.