kernel: ip17xx: use pr_warn instead of pr_warning
[openwrt/staging/rmilecki.git] / target / linux / generic / files / drivers / net / phy / ip17xx.c
index 646a8426548c16d9d5edf7da8af5382e4974527f..88bdc29cb7eee7ea17b35855c36df9e3a154a8c7 100644 (file)
@@ -3,7 +3,7 @@
  *
  * 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
@@ -329,7 +329,7 @@ static int ip_phy_read(struct ip17xx_state *state, int port, int reg)
 {
        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);
@@ -346,7 +346,7 @@ static int ip_phy_write(struct ip17xx_state *state, int port, int reg, u16 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;
 }
 
@@ -451,7 +451,7 @@ static int get_model(struct ip17xx_state *state)
                        }
                }
        } 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;
@@ -1210,8 +1210,8 @@ static const struct switch_attr ip17xx_vlan[] = {
        [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,
        }
@@ -1273,7 +1273,7 @@ static int ip17xx_probe(struct phy_device *pdev)
        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);
@@ -1283,7 +1283,7 @@ static int ip17xx_probe(struct phy_device *pdev)
        dev = &state->dev;
 
        pdev->priv = state;
-       state->mii_bus = pdev->bus;
+       state->mii_bus = pdev->mdio.bus;
 
        err = get_model(state);
        if (err < 0)
@@ -1295,7 +1295,7 @@ static int ip17xx_probe(struct phy_device *pdev)
        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:
@@ -1334,7 +1334,7 @@ static int ip17xx_config_aneg(struct phy_device *pdev)
 
 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)
@@ -1353,58 +1353,25 @@ static int ip17xx_read_status(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);