]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
phy: phy-can-transceiver: Move OF ID table closer to their user
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Wed, 13 May 2026 22:01:28 +0000 (00:01 +0200)
committerVinod Koul <vkoul@kernel.org>
Thu, 14 May 2026 15:32:21 +0000 (21:02 +0530)
There is no code that uses ID table directly, except the
struct device_driver at the end of the file. Hence, move
table closer to its user. It's always possible to access
them via a pointer.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://patch.msgid.link/20260513220336.369628-4-andriy.shevchenko@linux.intel.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/phy/phy-can-transceiver.c

index 37b706d841ff5622f0178c0276b97295ad611c1b..5c9698f77c7d24d0997d67debbc2916a3ab057a1 100644 (file)
@@ -97,35 +97,6 @@ static const struct can_transceiver_data tja1057_drvdata = {
        .flags = CAN_TRANSCEIVER_SILENT_PRESENT,
 };
 
-static const struct of_device_id can_transceiver_phy_ids[] = {
-       {
-               .compatible = "ti,tcan1042",
-               .data = &tcan1042_drvdata
-       },
-       {
-               .compatible = "ti,tcan1043",
-               .data = &tcan1043_drvdata
-       },
-       {
-               .compatible = "nxp,tja1048",
-               .data = &tja1048_drvdata
-       },
-       {
-               .compatible = "nxp,tja1051",
-               .data = &tja1051_drvdata
-       },
-       {
-               .compatible = "nxp,tja1057",
-               .data = &tja1057_drvdata
-       },
-       {
-               .compatible = "nxp,tjr1443",
-               .data = &tcan1043_drvdata
-       },
-       { }
-};
-MODULE_DEVICE_TABLE(of, can_transceiver_phy_ids);
-
 static struct phy *can_transceiver_phy_xlate(struct device *dev,
                                             const struct of_phandle_args *args)
 {
@@ -232,6 +203,35 @@ static int can_transceiver_phy_probe(struct platform_device *pdev)
        return PTR_ERR_OR_ZERO(phy_provider);
 }
 
+static const struct of_device_id can_transceiver_phy_ids[] = {
+       {
+               .compatible = "ti,tcan1042",
+               .data = &tcan1042_drvdata
+       },
+       {
+               .compatible = "ti,tcan1043",
+               .data = &tcan1043_drvdata
+       },
+       {
+               .compatible = "nxp,tja1048",
+               .data = &tja1048_drvdata
+       },
+       {
+               .compatible = "nxp,tja1051",
+               .data = &tja1051_drvdata
+       },
+       {
+               .compatible = "nxp,tja1057",
+               .data = &tja1057_drvdata
+       },
+       {
+               .compatible = "nxp,tjr1443",
+               .data = &tcan1043_drvdata
+       },
+       { }
+};
+MODULE_DEVICE_TABLE(of, can_transceiver_phy_ids);
+
 static struct platform_driver can_transceiver_phy_driver = {
        .probe = can_transceiver_phy_probe,
        .driver = {