Linux CAN drivers development
 help / color / mirror / Atom feed
From: haibo.chen@nxp.com
To: robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org,
	conor+dt@kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de,
	wg@grandegger.com, mkl@pengutronix.de
Cc: kernel@pengutronix.de, linux-imx@nxp.com, davem@davemloft.net,
	edumazet@google.com, kuba@kernel.org, pabeni@redhat.com,
	haibo.chen@nxp.com, devicetree@vger.kernel.org,
	linux-can@vger.kernel.org, netdev@vger.kernel.org
Subject: [PATCH v2 3/3] can: flexcan: lack of stop mode dts properity should not block driver probe
Date: Wed, 26 Jul 2023 17:09:09 +0800	[thread overview]
Message-ID: <20230726090909.3417030-3-haibo.chen@nxp.com> (raw)
In-Reply-To: <20230726090909.3417030-1-haibo.chen@nxp.com>

From: Haibo Chen <haibo.chen@nxp.com>

If SoC claim to support stop mode, but dts file do not contain the stop
mode properity, this should not block the driver probe. For this case,
the driver only need to skip the wakeup capable setting which means this
device do not support the feature to wakeup system.

Signed-off-by: Haibo Chen <haibo.chen@nxp.com>
---
 drivers/net/can/flexcan/flexcan-core.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/drivers/net/can/flexcan/flexcan-core.c b/drivers/net/can/flexcan/flexcan-core.c
index a3f3a9c909be..d8be69f4a0c3 100644
--- a/drivers/net/can/flexcan/flexcan-core.c
+++ b/drivers/net/can/flexcan/flexcan-core.c
@@ -1987,7 +1987,14 @@ static int flexcan_setup_stop_mode(struct platform_device *pdev)
 		/* return 0 directly if doesn't support stop mode feature */
 		return 0;
 
-	if (ret)
+	/* If ret is -EINVAL, this means SoC claim to support stop mode, but
+	 * dts file lack the stop mode property definition. For this case,
+	 * directly return 0, this will skip the wakeup capable setting and
+	 * will not block the driver probe.
+	 */
+	if (ret == -EINVAL)
+		return 0;
+	else if (ret)
 		return ret;
 
 	device_set_wakeup_capable(&pdev->dev, true);
-- 
2.34.1


  parent reply	other threads:[~2023-07-26  9:10 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-26  9:09 [PATCH v2 1/3] arm64: dts: imx93: add the Flex-CAN stop mode by GPR haibo.chen
2023-07-26  9:09 ` [PATCH v2 2/3] can: flexcan: remove the auto stop mode for IMX93 haibo.chen
2023-07-26  9:09 ` haibo.chen [this message]
2023-07-26 10:16   ` [PATCH v2 3/3] can: flexcan: lack of stop mode dts properity should not block driver probe Marc Kleine-Budde
2023-07-26 11:10     ` Bough Chen
2023-07-26  9:57 ` [PATCH v2 1/3] arm64: dts: imx93: add the Flex-CAN stop mode by GPR Marc Kleine-Budde
2023-07-26 11:10   ` Bough Chen
2023-07-26 11:12     ` Marc Kleine-Budde

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=20230726090909.3417030-3-haibo.chen@nxp.com \
    --to=haibo.chen@nxp.com \
    --cc=conor+dt@kernel.org \
    --cc=davem@davemloft.net \
    --cc=devicetree@vger.kernel.org \
    --cc=edumazet@google.com \
    --cc=kernel@pengutronix.de \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=kuba@kernel.org \
    --cc=linux-can@vger.kernel.org \
    --cc=linux-imx@nxp.com \
    --cc=mkl@pengutronix.de \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=robh+dt@kernel.org \
    --cc=s.hauer@pengutronix.de \
    --cc=shawnguo@kernel.org \
    --cc=wg@grandegger.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