*
* Copyright (C) 2008 Patrick Horn <patrick.horn@gmail.com>
* Copyright (C) 2008, 2010 Martin Mares <mj@ucw.cz>
- * Copyright (C) 2009 Felix Fietkau <nbd@openwrt.org>
+ * Copyright (C) 2009 Felix Fietkau <nbd@nbd.name>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
{
int val = mdiobus_read(state->mii_bus, port, reg);
if (val < 0)
- pr_warning("IP17xx: Unable to get MII register %d,%d: error %d\n", port, reg, -val);
+ pr_warn("IP17xx: Unable to get MII register %d,%d: error %d\n", port, reg, -val);
#ifdef DUMP_MII_IO
else
pr_debug("IP17xx: Read MII(%d,%d) -> %04x\n", port, reg, val);
#endif
err = mdiobus_write(state->mii_bus, port, reg, val);
if (err < 0)
- pr_warning("IP17xx: Unable to write MII register %d,%d: error %d\n", port, reg, -err);
+ pr_warn("IP17xx: Unable to write MII register %d,%d: error %d\n", port, reg, -err);
return err;
}
}
}
} else {
- pr_warning("IP17xx: Found an unknown IC+ switch with model number %02x, revision %X.\n", model_no, rev_no);
+ pr_warn("IP17xx: Found an unknown IC+ switch with model number %02x, revision %X.\n", model_no, rev_no);
return -EPERM;
}
return 0;
[IP17XX_VLAN_TAG] = {
.id = IP17XX_VLAN_TAG,
.type = SWITCH_TYPE_INT,
- .description = "VLAN tag (0-4095) [IP175D only]",
- .name = "tag",
+ .description = "VLAN ID (0-4095) [IP175D only]",
+ .name = "vid",
.get = ip17xx_get_tag,
.set = ip17xx_set_tag,
}
int err;
/* We only attach to PHY 0, but use all available PHYs */
- if (pdev->addr != 0)
+ if (pdev->mdio.addr != 0)
return -ENODEV;
state = kzalloc(sizeof(*state), GFP_KERNEL);
dev = &state->dev;
pdev->priv = state;
- state->mii_bus = pdev->bus;
+ state->mii_bus = pdev->mdio.bus;
err = get_model(state);
if (err < 0)
dev->name = state->regs->NAME;
dev->ops = &ip17xx_ops;
- pr_info("IP17xx: Found %s at %s\n", dev->name, dev_name(&pdev->dev));
+ pr_info("IP17xx: Found %s at %s\n", dev->name, dev_name(&pdev->mdio.dev));
return 0;
error:
static int ip17xx_aneg_done(struct phy_device *pdev)
{
- return BMSR_ANEGCOMPLETE;
+ return 1; /* Return any positive value */
}
static int ip17xx_update_link(struct phy_device *pdev)
return 0;
}
-static struct phy_driver ip17xx_driver = {
- .name = "IC+ IP17xx",
- .phy_id = 0x02430c00,
- .phy_id_mask = 0x0ffffc00,
- .features = PHY_BASIC_FEATURES,
- .probe = ip17xx_probe,
- .remove = ip17xx_remove,
- .config_init = ip17xx_config_init,
- .config_aneg = ip17xx_config_aneg,
- .aneg_done = ip17xx_aneg_done,
- .update_link = ip17xx_update_link,
- .read_status = ip17xx_read_status,
- .driver = { .owner = THIS_MODULE },
-};
-
-static struct phy_driver ip175a_driver = {
- .name = "IC+ IP175A",
- .phy_id = 0x02430c50,
- .phy_id_mask = 0x0ffffff0,
- .features = PHY_BASIC_FEATURES,
- .probe = ip17xx_probe,
- .remove = ip17xx_remove,
- .config_init = ip17xx_config_init,
- .config_aneg = ip17xx_config_aneg,
- .aneg_done = ip17xx_aneg_done,
- .update_link = ip17xx_update_link,
- .read_status = ip17xx_read_status,
- .driver = { .owner = THIS_MODULE },
+static struct phy_driver ip17xx_driver[] = {
+ {
+ .name = "IC+ IP17xx",
+ .phy_id = 0x02430c00,
+ .phy_id_mask = 0x0ffffc00,
+ .features = PHY_BASIC_FEATURES,
+ .probe = ip17xx_probe,
+ .remove = ip17xx_remove,
+ .config_init = ip17xx_config_init,
+ .config_aneg = ip17xx_config_aneg,
+ .aneg_done = ip17xx_aneg_done,
+ .update_link = ip17xx_update_link,
+ .read_status = ip17xx_read_status,
+ }
};
-
-int __init ip17xx_init(void)
-{
- int ret;
-
- ret = phy_driver_register(&ip175a_driver);
- if (ret < 0)
- return ret;
-
- return phy_driver_register(&ip17xx_driver);
-}
-
-void __exit ip17xx_exit(void)
-{
- phy_driver_unregister(&ip17xx_driver);
- phy_driver_unregister(&ip175a_driver);
-}
+module_phy_driver(ip17xx_driver);
MODULE_AUTHOR("Patrick Horn <patrick.horn@gmail.com>");
-MODULE_AUTHOR("Felix Fietkau <nbd@openwrt.org>");
+MODULE_AUTHOR("Felix Fietkau <nbd@nbd.name>");
MODULE_AUTHOR("Martin Mares <mj@ucw.cz>");
MODULE_LICENSE("GPL");
-
-module_init(ip17xx_init);
-module_exit(ip17xx_exit);