summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2020-08-28 13:27:52 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2020-10-01 08:32:19 +0200
commit13f237e2d84c875d9f4bcbdfe513a18a269ceaee (patch)
tree29f527ac7038d43c95e29f605af681cece3f670e /drivers
parent788619897249e6ad55f2d879cbea58e737852372 (diff)
downloadbarebox-13f237e2d84c875d9f4bcbdfe513a18a269ceaee.tar.gz
barebox-13f237e2d84c875d9f4bcbdfe513a18a269ceaee.tar.xz
net: phy: Add and use driver register macro
Add driver registration macros for phy drivers similar to the existing platform device macros. This also changes the initcall level from fs_initcall to device_initcall for the phy drivers. It is not clear why the phy driver have been at fs_initcall in the first place, changing it shouldn't be a problem. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/phy/ar8327.c7
-rw-r--r--drivers/net/phy/at803x.c7
-rw-r--r--drivers/net/phy/davicom.c7
-rw-r--r--drivers/net/phy/dp83867.c6
-rw-r--r--drivers/net/phy/lxt.c7
-rw-r--r--drivers/net/phy/marvell.c7
-rw-r--r--drivers/net/phy/micrel.c7
-rw-r--r--drivers/net/phy/mv88e6xxx/port.c8
-rw-r--r--drivers/net/phy/national.c6
-rw-r--r--drivers/net/phy/phy.c6
-rw-r--r--drivers/net/phy/realtek.c7
-rw-r--r--drivers/net/phy/smsc.c6
12 files changed, 13 insertions, 68 deletions
diff --git a/drivers/net/phy/ar8327.c b/drivers/net/phy/ar8327.c
index 5f3a2e2cf2..f13d574b30 100644
--- a/drivers/net/phy/ar8327.c
+++ b/drivers/net/phy/ar8327.c
@@ -268,9 +268,4 @@ static struct phy_driver ar8327n_driver[] = {
.aneg_done = &ar8327n_aneg_done,
}};
-static int atheros_phy_init(void)
-{
- return phy_drivers_register(ar8327n_driver,
- ARRAY_SIZE(ar8327n_driver));
-}
-fs_initcall(atheros_phy_init);
+device_phy_drivers(ar8327n_driver);
diff --git a/drivers/net/phy/at803x.c b/drivers/net/phy/at803x.c
index de053a36fb..016ed97020 100644
--- a/drivers/net/phy/at803x.c
+++ b/drivers/net/phy/at803x.c
@@ -243,9 +243,4 @@ static struct phy_driver at803x_driver[] = {
.read_status = &genphy_read_status,
} };
-static int atheros_phy_init(void)
-{
- return phy_drivers_register(at803x_driver,
- ARRAY_SIZE(at803x_driver));
-}
-fs_initcall(atheros_phy_init);
+device_phy_drivers(at803x_driver);
diff --git a/drivers/net/phy/davicom.c b/drivers/net/phy/davicom.c
index febaffa52c..794e5f2c96 100644
--- a/drivers/net/phy/davicom.c
+++ b/drivers/net/phy/davicom.c
@@ -127,9 +127,4 @@ static struct phy_driver dm91xx_driver[] = {
.features = PHY_BASIC_FEATURES,
} };
-static int dm9161_init(void)
-{
- return phy_drivers_register(dm91xx_driver,
- ARRAY_SIZE(dm91xx_driver));
-}
-fs_initcall(dm9161_init);
+device_phy_drivers(dm91xx_driver);
diff --git a/drivers/net/phy/dp83867.c b/drivers/net/phy/dp83867.c
index 929a407b09..8131e8c9d6 100644
--- a/drivers/net/phy/dp83867.c
+++ b/drivers/net/phy/dp83867.c
@@ -311,8 +311,4 @@ static struct phy_driver dp83867_driver[] = {
},
};
-static int dp83867_phy_init(void)
-{
- return phy_drivers_register(dp83867_driver, ARRAY_SIZE(dp83867_driver));
-}
-fs_initcall(dp83867_phy_init);
+device_phy_drivers(dp83867_driver);
diff --git a/drivers/net/phy/lxt.c b/drivers/net/phy/lxt.c
index b661ae7316..9b023c8c40 100644
--- a/drivers/net/phy/lxt.c
+++ b/drivers/net/phy/lxt.c
@@ -19,9 +19,4 @@ static struct phy_driver lxt97x_driver[] = {
.features = PHY_BASIC_FEATURES,
} };
-static int lxt97x_phy_init(void)
-{
- return phy_drivers_register(lxt97x_driver,
- ARRAY_SIZE(lxt97x_driver));
-}
-fs_initcall(lxt97x_phy_init);
+device_phy_drivers(lxt97x_driver);
diff --git a/drivers/net/phy/marvell.c b/drivers/net/phy/marvell.c
index af39ed68fd..3bf0fef34b 100644
--- a/drivers/net/phy/marvell.c
+++ b/drivers/net/phy/marvell.c
@@ -733,9 +733,4 @@ static struct phy_driver marvell_drivers[] = {
},
};
-static int __init marvell_phy_init(void)
-{
- return phy_drivers_register(marvell_drivers,
- ARRAY_SIZE(marvell_drivers));
-}
-fs_initcall(marvell_phy_init);
+device_phy_drivers(marvell_drivers);
diff --git a/drivers/net/phy/micrel.c b/drivers/net/phy/micrel.c
index 4655430573..4e46370241 100644
--- a/drivers/net/phy/micrel.c
+++ b/drivers/net/phy/micrel.c
@@ -537,9 +537,4 @@ static struct phy_driver ksphy_driver[] = {
.read_status = ksz8873mll_read_status,
} };
-static int ksphy_init(void)
-{
- return phy_drivers_register(ksphy_driver,
- ARRAY_SIZE(ksphy_driver));
-}
-fs_initcall(ksphy_init);
+device_phy_drivers(ksphy_driver);
diff --git a/drivers/net/phy/mv88e6xxx/port.c b/drivers/net/phy/mv88e6xxx/port.c
index 52f95d622c..3f10719d9a 100644
--- a/drivers/net/phy/mv88e6xxx/port.c
+++ b/drivers/net/phy/mv88e6xxx/port.c
@@ -547,11 +547,7 @@ static struct phy_driver mv88e6xxx_port_driver = {
.read_status = mv88e6xxx_port_read_status,
};
-static int __init mv88e6xxx_port_driver_register(void)
-{
- return phy_driver_register(&mv88e6xxx_port_driver);
-}
-fs_initcall(mv88e6xxx_port_driver_register);
+device_phy_driver(mv88e6xxx_port_driver);
int mv88e6xxx_port_probe(struct mv88e6xxx_chip *chip)
{
@@ -660,4 +656,4 @@ int mv88e6xxx_port_probe(struct mv88e6xxx_chip *chip)
}
return 0;
-} \ No newline at end of file
+}
diff --git a/drivers/net/phy/national.c b/drivers/net/phy/national.c
index 83390b99ab..d74cd81933 100644
--- a/drivers/net/phy/national.c
+++ b/drivers/net/phy/national.c
@@ -84,8 +84,4 @@ static struct phy_driver dp83865_driver = {
.config_init = ns_config_init,
};
-static int ns_phy_init(void)
-{
- return phy_driver_register(&dp83865_driver);
-}
-fs_initcall(ns_phy_init);
+device_phy_driver(dp83865_driver);
diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c
index 57c2f8044f..622acbe40d 100644
--- a/drivers/net/phy/phy.c
+++ b/drivers/net/phy/phy.c
@@ -981,8 +981,4 @@ static struct phy_driver genphy_driver = {
SUPPORTED_BNC,
};
-static int generic_phy_register(void)
-{
- return phy_driver_register(&genphy_driver);
-}
-device_initcall(generic_phy_register);
+device_phy_driver(genphy_driver);
diff --git a/drivers/net/phy/realtek.c b/drivers/net/phy/realtek.c
index 695a6c384d..9ba0495d41 100644
--- a/drivers/net/phy/realtek.c
+++ b/drivers/net/phy/realtek.c
@@ -196,9 +196,4 @@ static struct phy_driver realtek_drvs[] = {
},
};
-static int __init realtek_phy_init(void)
-{
- return phy_drivers_register(realtek_drvs,
- ARRAY_SIZE(realtek_drvs));
-}
-fs_initcall(realtek_phy_init);
+device_phy_drivers(realtek_drvs);
diff --git a/drivers/net/phy/smsc.c b/drivers/net/phy/smsc.c
index d6705e4fe2..1e1f3d5274 100644
--- a/drivers/net/phy/smsc.c
+++ b/drivers/net/phy/smsc.c
@@ -135,8 +135,4 @@ static struct phy_driver smsc_phy_driver[] = {
.config_init = lan87xx_config_init,
} };
-static int __init smsc_init(void)
-{
- return phy_drivers_register(smsc_phy_driver, ARRAY_SIZE(smsc_phy_driver));
-}
-fs_initcall(smsc_init);
+device_phy_drivers(smsc_phy_driver);