Skip to content

Commit bd8ca17

Browse files
zonquedavem330
authored andcommitted
net: phy: at803x: use #defines for supported PHY ids
This removes magic values from two tables and also allows us to match against specific PHY models at runtime. Signed-off-by: Daniel Mack <zonque@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 2b8f2a2 commit bd8ca17

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

drivers/net/phy/at803x.c

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@
3535
#define AT803X_DEBUG_SYSTEM_MODE_CTRL 0x05
3636
#define AT803X_DEBUG_RGMII_TX_CLK_DLY BIT(8)
3737

38+
#define ATH8030_PHY_ID 0x004dd076
39+
#define ATH8031_PHY_ID 0x004dd074
40+
#define ATH8035_PHY_ID 0x004dd072
41+
3842
MODULE_DESCRIPTION("Atheros 803x PHY driver");
3943
MODULE_AUTHOR("Matus Ujhelyi");
4044
MODULE_LICENSE("GPL");
@@ -192,7 +196,7 @@ static int at803x_config_intr(struct phy_device *phydev)
192196
static struct phy_driver at803x_driver[] = {
193197
{
194198
/* ATHEROS 8035 */
195-
.phy_id = 0x004dd072,
199+
.phy_id = ATH8035_PHY_ID,
196200
.name = "Atheros 8035 ethernet",
197201
.phy_id_mask = 0xffffffef,
198202
.config_init = at803x_config_init,
@@ -209,7 +213,7 @@ static struct phy_driver at803x_driver[] = {
209213
},
210214
}, {
211215
/* ATHEROS 8030 */
212-
.phy_id = 0x004dd076,
216+
.phy_id = ATH8030_PHY_ID,
213217
.name = "Atheros 8030 ethernet",
214218
.phy_id_mask = 0xffffffef,
215219
.config_init = at803x_config_init,
@@ -226,7 +230,7 @@ static struct phy_driver at803x_driver[] = {
226230
},
227231
}, {
228232
/* ATHEROS 8031 */
229-
.phy_id = 0x004dd074,
233+
.phy_id = ATH8031_PHY_ID,
230234
.name = "Atheros 8031 ethernet",
231235
.phy_id_mask = 0xffffffef,
232236
.config_init = at803x_config_init,
@@ -260,9 +264,9 @@ module_init(atheros_init);
260264
module_exit(atheros_exit);
261265

262266
static struct mdio_device_id __maybe_unused atheros_tbl[] = {
263-
{ 0x004dd076, 0xffffffef },
264-
{ 0x004dd074, 0xffffffef },
265-
{ 0x004dd072, 0xffffffef },
267+
{ ATH8030_PHY_ID, 0xffffffef },
268+
{ ATH8031_PHY_ID, 0xffffffef },
269+
{ ATH8035_PHY_ID, 0xffffffef },
266270
{ }
267271
};
268272

0 commit comments

Comments
 (0)