* [PATCH] can: tcan4x5x: fix power regulator retrieval during probe
@ 2025-06-12 19:18 Brett Werling
2025-06-13 7:30 ` Marc Kleine-Budde
0 siblings, 1 reply; 3+ messages in thread
From: Brett Werling @ 2025-06-12 19:18 UTC (permalink / raw)
To: linux-can, linux-kernel
Cc: Marc Kleine-Budde, Vincent Mailhol, bwerl.dev, Brett Werling
Fixes the power regulator retrieval in tcan4x5x_can_probe() by ensuring
the regulator pointer is not set to NULL in the successful return from
devm_regulator_get_optional().
Fixes: 3814ca3a10be ("can: tcan4x5x: tcan4x5x_can_probe(): turn on the power before parsing the config")
Signed-off-by: Brett Werling <brett.werling@garmin.com>
---
drivers/net/can/m_can/tcan4x5x-core.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/drivers/net/can/m_can/tcan4x5x-core.c b/drivers/net/can/m_can/tcan4x5x-core.c
index e5c162f8c589..8edaa339d590 100644
--- a/drivers/net/can/m_can/tcan4x5x-core.c
+++ b/drivers/net/can/m_can/tcan4x5x-core.c
@@ -411,10 +411,11 @@ static int tcan4x5x_can_probe(struct spi_device *spi)
priv = cdev_to_priv(mcan_class);
priv->power = devm_regulator_get_optional(&spi->dev, "vsup");
- if (PTR_ERR(priv->power) == -EPROBE_DEFER) {
- ret = -EPROBE_DEFER;
- goto out_m_can_class_free_dev;
- } else {
+ if (IS_ERR(priv->power)) {
+ if (PTR_ERR(priv->power) == -EPROBE_DEFER) {
+ ret = -EPROBE_DEFER;
+ goto out_m_can_class_free_dev;
+ }
priv->power = NULL;
}
--
2.49.0
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH] can: tcan4x5x: fix power regulator retrieval during probe 2025-06-12 19:18 [PATCH] can: tcan4x5x: fix power regulator retrieval during probe Brett Werling @ 2025-06-13 7:30 ` Marc Kleine-Budde [not found] ` <3302f4d4-a863-4a88-83af-8f09b4191bb3@gmail.com> 0 siblings, 1 reply; 3+ messages in thread From: Marc Kleine-Budde @ 2025-06-13 7:30 UTC (permalink / raw) To: Brett Werling; +Cc: linux-can, linux-kernel, Vincent Mailhol, bwerl.dev [-- Attachment #1: Type: text/plain, Size: 733 bytes --] On 12.06.2025 14:18:25, Brett Werling wrote: > Fixes the power regulator retrieval in tcan4x5x_can_probe() by ensuring > the regulator pointer is not set to NULL in the successful return from > devm_regulator_get_optional(). > > Fixes: 3814ca3a10be ("can: tcan4x5x: tcan4x5x_can_probe(): turn on the power before parsing the config") > Signed-off-by: Brett Werling <brett.werling@garmin.com> Applied to linux-can and added stable on Cc. Thanks, Marc -- Pengutronix e.K. | Marc Kleine-Budde | Embedded Linux | https://www.pengutronix.de | Vertretung Nürnberg | Phone: +49-5121-206917-129 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-9 | [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 488 bytes --] ^ permalink raw reply [flat|nested] 3+ messages in thread
[parent not found: <3302f4d4-a863-4a88-83af-8f09b4191bb3@gmail.com>]
* Re: [PATCH] can: tcan4x5x: fix power regulator retrieval during probe [not found] ` <3302f4d4-a863-4a88-83af-8f09b4191bb3@gmail.com> @ 2025-06-17 15:53 ` Marc Kleine-Budde 0 siblings, 0 replies; 3+ messages in thread From: Marc Kleine-Budde @ 2025-06-17 15:53 UTC (permalink / raw) To: Brett Werling; +Cc: linux-can [-- Attachment #1: Type: text/plain, Size: 861 bytes --] Hello Brett, On 17.06.2025 10:17:44, Brett Werling wrote: > Do you know when the final patch will be available on > https://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can.git? I'd like > to reference the proper SHA1 when back-porting to my company's kernel > repository. I've just send a PR to the netdev team and if I don't get any objections the patch will go mainline as: | db2272054520 ("can: tcan4x5x: fix power regulator retrieval during probe") The commit is now available on https://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can.git regards, Marc -- Pengutronix e.K. | Marc Kleine-Budde | Embedded Linux | https://www.pengutronix.de | Vertretung Nürnberg | Phone: +49-5121-206917-129 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-9 | [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 488 bytes --] ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-06-17 15:53 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-12 19:18 [PATCH] can: tcan4x5x: fix power regulator retrieval during probe Brett Werling
2025-06-13 7:30 ` Marc Kleine-Budde
[not found] ` <3302f4d4-a863-4a88-83af-8f09b4191bb3@gmail.com>
2025-06-17 15:53 ` Marc Kleine-Budde
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).