phy: phy-can-transceiver: Move OF ID table closer to their user

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>
This commit is contained in:
Andy Shevchenko 2026-05-14 00:01:28 +02:00 committed by Vinod Koul
parent 23db9fd578
commit 62455f6be1

View 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 = {