Linux kernel staging patches
 help / color / mirror / Atom feed
* [PATCH] staging: greybus: spilib: Remove the local unused
@ 2026-08-20 10:32 singh.supreet14
  2026-08-20 10:46 ` Johan Hovold
  0 siblings, 1 reply; 3+ messages in thread
From: singh.supreet14 @ 2026-08-20 10:32 UTC (permalink / raw)
  To: Viresh Kumar
  Cc: Rui Miguel Silva, Johan Hovold, Alex Elder, Greg Kroah-Hartman,
	greybus-dev, linux-staging, linux-kernel, Supreet Singh

From: Supreet Singh <singh.supreet14@gmail.com>

The return value of spi_new_device() is only used to check whether
device creation succeeded. Remove the unnecessary local variable and
check the return value directly.

Signed-off-by: Supreet Singh <singh.supreet14@gmail.com>
---
 drivers/staging/greybus/spilib.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/staging/greybus/spilib.c b/drivers/staging/greybus/spilib.c
index 39d5bf234c61..0e8711fdc429 100644
--- a/drivers/staging/greybus/spilib.c
+++ b/drivers/staging/greybus/spilib.c
@@ -444,7 +444,6 @@ static int gb_spi_setup_device(struct gb_spilib *spi, u8 cs)
 	struct gb_spi_device_config_request request;
 	struct gb_spi_device_config_response response;
 	struct spi_board_info spi_board = { {0} };
-	struct spi_device *spidev;
 	int ret;
 	u8 dev_type;
 
@@ -480,8 +479,7 @@ static int gb_spi_setup_device(struct gb_spilib *spi, u8 cs)
 	spi_board.chip_select	= cs;
 	spi_board.max_speed_hz	= le32_to_cpu(response.max_speed_hz);
 
-	spidev = spi_new_device(ctlr, &spi_board);
-	if (!spidev)
+	if (!spi_new_device(ctlr, &spi_board))
 		return -EINVAL;
 
 	return 0;
-- 
2.55.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-08-20 11:22 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-20 10:32 [PATCH] staging: greybus: spilib: Remove the local unused singh.supreet14
2026-08-20 10:46 ` Johan Hovold
2026-08-20 11:22   ` [PATCH] staging: greybus: spilib: Remove the local unused linux-kernel@vger.kernel.org Supreet Singh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox