diff options
author | Johan Hovold <johan@kernel.org> | 2014-11-11 13:45:58 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-11-12 13:52:53 -0500 |
commit | 116dffa0b543a2e560abd62a0b3207b1694f9ab9 (patch) | |
tree | bf26c3d107938367692f724596da9067cea09aa0 | |
parent | c31accd159a6477b91de61ae237dce38e3f3ee4d (diff) |
net: phy: replace phy_driver_register calls
Replace module init/exit which only calls phy_driver_register with
module_phy_driver macro.
Compile tested only.
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/phy/amd.c | 17 | ||||
-rw-r--r-- | drivers/net/phy/et1011c.c | 17 | ||||
-rw-r--r-- | drivers/net/phy/national.c | 17 | ||||
-rw-r--r-- | drivers/net/phy/qsemi.c | 17 |
4 files changed, 12 insertions, 56 deletions
diff --git a/drivers/net/phy/amd.c b/drivers/net/phy/amd.c index a3fb5ceb6487..65a488f82eb8 100644 --- a/drivers/net/phy/amd.c +++ b/drivers/net/phy/amd.c | |||
@@ -61,7 +61,7 @@ static int am79c_config_intr(struct phy_device *phydev) | |||
61 | return err; | 61 | return err; |
62 | } | 62 | } |
63 | 63 | ||
64 | static struct phy_driver am79c_driver = { | 64 | static struct phy_driver am79c_driver[] = { { |
65 | .phy_id = PHY_ID_AM79C874, | 65 | .phy_id = PHY_ID_AM79C874, |
66 | .name = "AM79C874", | 66 | .name = "AM79C874", |
67 | .phy_id_mask = 0xfffffff0, | 67 | .phy_id_mask = 0xfffffff0, |
@@ -73,20 +73,9 @@ static struct phy_driver am79c_driver = { | |||
73 | .ack_interrupt = am79c_ack_interrupt, | 73 | .ack_interrupt = am79c_ack_interrupt, |
74 | .config_intr = am79c_config_intr, | 74 | .config_intr = am79c_config_intr, |
75 | .driver = { .owner = THIS_MODULE,}, | 75 | .driver = { .owner = THIS_MODULE,}, |
76 | }; | 76 | } }; |
77 | |||
78 | static int __init am79c_init(void) | ||
79 | { | ||
80 | return phy_driver_register(&am79c_driver); | ||
81 | } | ||
82 | |||
83 | static void __exit am79c_exit(void) | ||
84 | { | ||
85 | phy_driver_unregister(&am79c_driver); | ||
86 | } | ||
87 | 77 | ||
88 | module_init(am79c_init); | 78 | module_phy_driver(am79c_driver); |
89 | module_exit(am79c_exit); | ||
90 | 79 | ||
91 | static struct mdio_device_id __maybe_unused amd_tbl[] = { | 80 | static struct mdio_device_id __maybe_unused amd_tbl[] = { |
92 | { PHY_ID_AM79C874, 0xfffffff0 }, | 81 | { PHY_ID_AM79C874, 0xfffffff0 }, |
diff --git a/drivers/net/phy/et1011c.c b/drivers/net/phy/et1011c.c index a8eb19ec3183..a907743816a8 100644 --- a/drivers/net/phy/et1011c.c +++ b/drivers/net/phy/et1011c.c | |||
@@ -87,7 +87,7 @@ static int et1011c_read_status(struct phy_device *phydev) | |||
87 | return ret; | 87 | return ret; |
88 | } | 88 | } |
89 | 89 | ||
90 | static struct phy_driver et1011c_driver = { | 90 | static struct phy_driver et1011c_driver[] = { { |
91 | .phy_id = 0x0282f014, | 91 | .phy_id = 0x0282f014, |
92 | .name = "ET1011C", | 92 | .name = "ET1011C", |
93 | .phy_id_mask = 0xfffffff0, | 93 | .phy_id_mask = 0xfffffff0, |
@@ -96,20 +96,9 @@ static struct phy_driver et1011c_driver = { | |||
96 | .config_aneg = et1011c_config_aneg, | 96 | .config_aneg = et1011c_config_aneg, |
97 | .read_status = et1011c_read_status, | 97 | .read_status = et1011c_read_status, |
98 | .driver = { .owner = THIS_MODULE,}, | 98 | .driver = { .owner = THIS_MODULE,}, |
99 | }; | 99 | } }; |
100 | |||
101 | static int __init et1011c_init(void) | ||
102 | { | ||
103 | return phy_driver_register(&et1011c_driver); | ||
104 | } | ||
105 | |||
106 | static void __exit et1011c_exit(void) | ||
107 | { | ||
108 | phy_driver_unregister(&et1011c_driver); | ||
109 | } | ||
110 | 100 | ||
111 | module_init(et1011c_init); | 101 | module_phy_driver(et1011c_driver); |
112 | module_exit(et1011c_exit); | ||
113 | 102 | ||
114 | static struct mdio_device_id __maybe_unused et1011c_tbl[] = { | 103 | static struct mdio_device_id __maybe_unused et1011c_tbl[] = { |
115 | { 0x0282f014, 0xfffffff0 }, | 104 | { 0x0282f014, 0xfffffff0 }, |
diff --git a/drivers/net/phy/national.c b/drivers/net/phy/national.c index 9a5f234d95b0..0a7b9c7f09a2 100644 --- a/drivers/net/phy/national.c +++ b/drivers/net/phy/national.c | |||
@@ -129,7 +129,7 @@ static int ns_config_init(struct phy_device *phydev) | |||
129 | return ns_ack_interrupt(phydev); | 129 | return ns_ack_interrupt(phydev); |
130 | } | 130 | } |
131 | 131 | ||
132 | static struct phy_driver dp83865_driver = { | 132 | static struct phy_driver dp83865_driver[] = { { |
133 | .phy_id = DP83865_PHY_ID, | 133 | .phy_id = DP83865_PHY_ID, |
134 | .phy_id_mask = 0xfffffff0, | 134 | .phy_id_mask = 0xfffffff0, |
135 | .name = "NatSemi DP83865", | 135 | .name = "NatSemi DP83865", |
@@ -141,25 +141,14 @@ static struct phy_driver dp83865_driver = { | |||
141 | .ack_interrupt = ns_ack_interrupt, | 141 | .ack_interrupt = ns_ack_interrupt, |
142 | .config_intr = ns_config_intr, | 142 | .config_intr = ns_config_intr, |
143 | .driver = {.owner = THIS_MODULE,} | 143 | .driver = {.owner = THIS_MODULE,} |
144 | }; | 144 | } }; |
145 | 145 | ||
146 | static int __init ns_init(void) | 146 | module_phy_driver(dp83865_driver); |
147 | { | ||
148 | return phy_driver_register(&dp83865_driver); | ||
149 | } | ||
150 | |||
151 | static void __exit ns_exit(void) | ||
152 | { | ||
153 | phy_driver_unregister(&dp83865_driver); | ||
154 | } | ||
155 | 147 | ||
156 | MODULE_DESCRIPTION("NatSemi PHY driver"); | 148 | MODULE_DESCRIPTION("NatSemi PHY driver"); |
157 | MODULE_AUTHOR("Stuart Menefy"); | 149 | MODULE_AUTHOR("Stuart Menefy"); |
158 | MODULE_LICENSE("GPL"); | 150 | MODULE_LICENSE("GPL"); |
159 | 151 | ||
160 | module_init(ns_init); | ||
161 | module_exit(ns_exit); | ||
162 | |||
163 | static struct mdio_device_id __maybe_unused ns_tbl[] = { | 152 | static struct mdio_device_id __maybe_unused ns_tbl[] = { |
164 | { DP83865_PHY_ID, 0xfffffff0 }, | 153 | { DP83865_PHY_ID, 0xfffffff0 }, |
165 | { } | 154 | { } |
diff --git a/drivers/net/phy/qsemi.c b/drivers/net/phy/qsemi.c index fe0d0a15d5e1..be4c6f7c3645 100644 --- a/drivers/net/phy/qsemi.c +++ b/drivers/net/phy/qsemi.c | |||
@@ -111,7 +111,7 @@ static int qs6612_config_intr(struct phy_device *phydev) | |||
111 | 111 | ||
112 | } | 112 | } |
113 | 113 | ||
114 | static struct phy_driver qs6612_driver = { | 114 | static struct phy_driver qs6612_driver[] = { { |
115 | .phy_id = 0x00181440, | 115 | .phy_id = 0x00181440, |
116 | .name = "QS6612", | 116 | .name = "QS6612", |
117 | .phy_id_mask = 0xfffffff0, | 117 | .phy_id_mask = 0xfffffff0, |
@@ -123,20 +123,9 @@ static struct phy_driver qs6612_driver = { | |||
123 | .ack_interrupt = qs6612_ack_interrupt, | 123 | .ack_interrupt = qs6612_ack_interrupt, |
124 | .config_intr = qs6612_config_intr, | 124 | .config_intr = qs6612_config_intr, |
125 | .driver = { .owner = THIS_MODULE,}, | 125 | .driver = { .owner = THIS_MODULE,}, |
126 | }; | 126 | } }; |
127 | |||
128 | static int __init qs6612_init(void) | ||
129 | { | ||
130 | return phy_driver_register(&qs6612_driver); | ||
131 | } | ||
132 | |||
133 | static void __exit qs6612_exit(void) | ||
134 | { | ||
135 | phy_driver_unregister(&qs6612_driver); | ||
136 | } | ||
137 | 127 | ||
138 | module_init(qs6612_init); | 128 | module_phy_driver(qs6612_driver); |
139 | module_exit(qs6612_exit); | ||
140 | 129 | ||
141 | static struct mdio_device_id __maybe_unused qs6612_tbl[] = { | 130 | static struct mdio_device_id __maybe_unused qs6612_tbl[] = { |
142 | { 0x00181440, 0xfffffff0 }, | 131 | { 0x00181440, 0xfffffff0 }, |