[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID:
<TY3PR01MB11346DC86A84518D92789A3A886D82@TY3PR01MB11346.jpnprd01.prod.outlook.com>
Date: Thu, 20 Mar 2025 15:00:44 +0000
From: Biju Das <biju.das.jz@...renesas.com>
To: Geert Uytterhoeven <geert+renesas@...der.be>, "Rob@....of.borg"
<Rob@....of.borg>, "Herring@....of.borg" <Herring@....of.borg>, Marc
Kleine-Budde <mkl@...gutronix.de>, Vincent Mailhol
<mailhol.vincent@...adoo.fr>, Vinod Koul <vkoul@...nel.org>, Kishon Vijay
Abraham I <kishon@...nel.org>, Peter Rosin <peda@...ntia.se>, Aswath
Govindraju <a-govindraju@...com>
CC: "linux-can@...r.kernel.org" <linux-can@...r.kernel.org>,
"linux-phy@...ts.infradead.org" <linux-phy@...ts.infradead.org>,
"linux-renesas-soc@...r.kernel.org" <linux-renesas-soc@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: RE: [PATCH] phy: can-transceiver: Re-instate "mux-states" property
presence check
Hi Geert,
> -----Original Message-----
> From: Geert Uytterhoeven <geert+renesas@...der.be>
> Sent: 19 March 2025 13:26
> Subject: [PATCH] phy: can-transceiver: Re-instate "mux-states" property presence check
>
> On the Renesas Gray Hawk Single development board:
>
> can-transceiver-phy can-phy0: /can-phy0: failed to get mux-state (0)
>
> "mux-states" is an optional property for CAN transceivers. However,
> mux_get() always prints an error message in case of an error, including when the property is not
> present, confusing the user.
>
> Fix this by re-instating the property presence check.
>
> This is bascially a revert of commit d02dfd4ceb2e9f34 ("phy:
> can-transceiver: Drop unnecessary "mux-states" property presence check"), with two changes:
> 1. Use the proper API for checking whether a property is present,
> 2. Do not print an error message, as the mux core already takes care
> of that.
>
> Fixes: d02dfd4ceb2e9f34 ("phy: can-transceiver: Drop unnecessary "mux-states" property presence
> check")
> Signed-off-by: Geert Uytterhoeven <geert+renesas@...der.be>
Tested-by: Biju Das <biju.das.jz@...renesas.com>
Tested on RZ/G3E SMARC EVK that has tcan1046v-q1 that is modelled as two
instances of tcan1042.
Cheers,
Biju
> ---
> Alternatively, the multiplexer subsystem needs to gain support for getting an optional mux...
> ---
> drivers/phy/phy-can-transceiver.c | 11 ++++++-----
> 1 file changed, 6 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/phy/phy-can-transceiver.c b/drivers/phy/phy-can-transceiver.c
> index 2bec70615449f94d..539b3446b9c33eed 100644
> --- a/drivers/phy/phy-can-transceiver.c
> +++ b/drivers/phy/phy-can-transceiver.c
> @@ -103,7 +103,6 @@ static int can_transceiver_phy_probe(struct platform_device *pdev)
> struct phy *phy;
> struct gpio_desc *standby_gpio;
> struct gpio_desc *enable_gpio;
> - struct mux_state *mux_state;
> u32 max_bitrate = 0;
> int err;
>
> @@ -114,11 +113,13 @@ static int can_transceiver_phy_probe(struct platform_device *pdev)
> match = of_match_node(can_transceiver_phy_ids, pdev->dev.of_node);
> drvdata = match->data;
>
> - mux_state = devm_mux_state_get(dev, NULL);
> - if (IS_ERR(mux_state)) {
> - if (PTR_ERR(mux_state) == -EPROBE_DEFER)
> + if (of_property_present(dev->of_node, "mux-states")) {
> + struct mux_state *mux_state;
> +
> + mux_state = devm_mux_state_get(dev, NULL);
> + if (IS_ERR(mux_state))
> return PTR_ERR(mux_state);
> - } else {
> +
> can_transceiver_phy->mux_state = mux_state;
> }
>
> --
> 2.43.0
>
Powered by blists - more mailing lists