mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Martin Hundebøll" <martin@geanix.com>
To: Markus Schneider-Pargmann <msp@baylibre.com>,
	Marc Kleine-Budde <mkl@pengutronix.de>,
	Vincent Mailhol <mailhol@kernel.org>,
	Sean Nyekjaer <sean@geanix.com>
Cc: Kendall Willis <k-willis@ti.com>,
	linux-can@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 2/2] can: tcan4x5x: Add suspend error handling
Date: Fri, 16 Oct 2026 10:04:00 +0000	[thread overview]
Message-ID: <9aba5682e371f5969d3ddca1c6a763485bc25285.camel@geanix.com> (raw)
In-Reply-To: <20261016-v7-3-topic-mcan-suspend-fix-fix-v2-2-7efa2b172cce@baylibre.com>

Hi Markus,

On Fri, 2026-10-16 at 11:57 +0200, Markus Schneider-Pargmann wrote:
> diff --git a/drivers/net/can/m_can/tcan4x5x-core.c
> b/drivers/net/can/m_can/tcan4x5x-core.c
> index a5b8829aa519..b69312413d62 100644
> --- a/drivers/net/can/m_can/tcan4x5x-core.c
> +++ b/drivers/net/can/m_can/tcan4x5x-core.c
> @@ -575,11 +575,20 @@ static int __maybe_unused
> tcan4x5x_suspend(struct device *dev)
>  {
>  	struct m_can_classdev *cdev = dev_get_drvdata(dev);
>  	struct spi_device *spi = to_spi_device(dev);
> +	int ret;
> 
>  	if (cdev->pm_wake_source)
>  		enable_irq_wake(spi->irq);
> 
> -	return m_can_class_suspend(dev);
> +	ret = m_can_class_suspend(dev);
> +	if (ret)
> +		goto err_disable_irq;
> +	return 0;
> +
> +err_disable_irq:
> +	if (cdev->pm_wake_source)
> +		disable_irq_wake(spi->irq);
> +	return ret;

Wouldn't this be better written in the shorter form:

	ret = m_can_class_suspend(dev);
	if (ret && dev->pm_wake_source)
		disable_irq_wake(spi->irq);

	return ret;

?

// Martin


      reply	other threads:[~2026-10-16 10:04 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-16  9:57 [PATCH v2 0/2] can: m_can: Fix suspend deinit() error path Markus Schneider-Pargmann (TI)
2026-10-16  9:57 ` [PATCH v2 1/2] " Markus Schneider-Pargmann (TI)
2026-10-16  9:57 ` [PATCH v2 2/2] can: tcan4x5x: Add suspend error handling Markus Schneider-Pargmann
2026-10-16 10:04   ` Martin Hundebøll [this message]

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=9aba5682e371f5969d3ddca1c6a763485bc25285.camel@geanix.com \
    --to=martin@geanix.com \
    --cc=k-willis@ti.com \
    --cc=linux-can@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mailhol@kernel.org \
    --cc=mkl@pengutronix.de \
    --cc=msp@baylibre.com \
    --cc=sean@geanix.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®