]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
phy: phy-can-transceiver: use device_get_match_data()
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Wed, 13 May 2026 22:01:27 +0000 (00:01 +0200)
committerVinod Koul <vkoul@kernel.org>
Thu, 14 May 2026 15:32:21 +0000 (21:02 +0530)
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 <josua@solid-run.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://patch.msgid.link/20260513220336.369628-3-andriy.shevchenko@linux.intel.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/phy/phy-can-transceiver.c

index 1808f903c05707657e1f25baf8f68641070a2b92..37b706d841ff5622f0178c0276b97295ad611c1b 100644 (file)
@@ -5,9 +5,9 @@
  * Copyright (C) 2021 Texas Instruments Incorporated - https://www.ti.com
  *
  */
-#include <linux/of.h>
 #include <linux/phy/phy.h>
 #include <linux/platform_device.h>
+#include <linux/property.h>
 #include <linux/module.h>
 #include <linux/gpio.h>
 #include <linux/gpio/consumer.h>
@@ -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);