From: Andy Shevchenko Date: Wed, 13 May 2026 22:01:27 +0000 (+0200) Subject: phy: phy-can-transceiver: use device_get_match_data() X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=23db9fd578ca3b446ceaa5c9a0157f0838f4df4e;p=thirdparty%2Fkernel%2Fstable.git phy: phy-can-transceiver: use device_get_match_data() Use the generic firmware node interface for retrieving device match data instead of the OF-specific one. While at it, drop unneeded argument to devm_phy_create() which extracts device node from the given device by default. Reviewed-by: Josua Mayer Signed-off-by: Andy Shevchenko Link: https://patch.msgid.link/20260513220336.369628-3-andriy.shevchenko@linux.intel.com Signed-off-by: Vinod Koul --- diff --git a/drivers/phy/phy-can-transceiver.c b/drivers/phy/phy-can-transceiver.c index 1808f903c057..37b706d841ff 100644 --- a/drivers/phy/phy-can-transceiver.c +++ b/drivers/phy/phy-can-transceiver.c @@ -5,9 +5,9 @@ * Copyright (C) 2021 Texas Instruments Incorporated - https://www.ti.com * */ -#include #include #include +#include #include #include #include @@ -152,7 +152,6 @@ static int can_transceiver_phy_probe(struct platform_device *pdev) struct can_transceiver_phy *can_transceiver_phy; struct can_transceiver_priv *priv; const struct can_transceiver_data *drvdata; - const struct of_device_id *match; struct phy *phy; struct gpio_desc *silent_gpio; struct gpio_desc *standby_gpio; @@ -161,11 +160,10 @@ static int can_transceiver_phy_probe(struct platform_device *pdev) u32 max_bitrate = 0; int err, i, num_ch = 1; - match = of_match_node(can_transceiver_phy_ids, pdev->dev.of_node); - if (!match || !match->data) + drvdata = device_get_match_data(dev); + if (!drvdata) return -ENODEV; - drvdata = match->data; if (drvdata->flags & CAN_TRANSCEIVER_DUAL_CH) num_ch = 2; @@ -190,7 +188,7 @@ static int can_transceiver_phy_probe(struct platform_device *pdev) can_transceiver_phy = &priv->can_transceiver_phy[i]; can_transceiver_phy->priv = priv; - phy = devm_phy_create(dev, dev->of_node, &can_transceiver_phy_ops); + phy = devm_phy_create(dev, NULL, &can_transceiver_phy_ops); if (IS_ERR(phy)) { dev_err(dev, "failed to create can transceiver phy\n"); return PTR_ERR(phy);