From: Johan Hovold <johan@kernel.org>
To: Mark Brown <broonie@kernel.org>
Cc: linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org,
Johan Hovold <johan@kernel.org>
Subject: [PATCH] spi: clean up controller registration return value
Date: Wed, 29 Apr 2026 11:23:01 +0200 [thread overview]
Message-ID: <20260429092301.166375-1-johan@kernel.org> (raw)
Return explicit zero on successful controller registration to make the
code more readable.
Signed-off-by: Johan Hovold <johan@kernel.org>
---
drivers/spi/spi.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c
index 104279858f56..5f57de24b9f7 100644
--- a/drivers/spi/spi.c
+++ b/drivers/spi/spi.c
@@ -3552,7 +3552,8 @@ int spi_register_controller(struct spi_controller *ctlr)
/* Register devices from the device tree and ACPI */
of_register_spi_devices(ctlr);
acpi_register_spi_devices(ctlr);
- return status;
+
+ return 0;
del_ctrl:
device_del(&ctlr->dev);
@@ -3560,6 +3561,7 @@ int spi_register_controller(struct spi_controller *ctlr)
mutex_lock(&board_lock);
idr_remove(&spi_controller_idr, ctlr->bus_num);
mutex_unlock(&board_lock);
+
return status;
}
EXPORT_SYMBOL_GPL(spi_register_controller);
--
2.53.0
next reply other threads:[~2026-04-29 9:23 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-29 9:23 Johan Hovold [this message]
2026-04-30 1:49 ` [PATCH] spi: clean up controller registration return value 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=20260429092301.166375-1-johan@kernel.org \
--to=johan@kernel.org \
--cc=broonie@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-spi@vger.kernel.org \
/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.