net: phy: bugfixes: mv88E61xx compiler warnings fixed
1. mv88E61xx driver compiler warnings fixed 2. idstr if-else statements changed to switch() construct and added default case too. This fixed idstr may be uninitialized warning Signed-off-by: Prafulla Wadaskar <prafulla@marvell.com> Signed-off-by: Ben Warren <biggerbadderben@gmail.com>
This commit is contained in:
parent
750326e5d5
commit
08c2df33f1
|
@ -38,7 +38,7 @@
|
||||||
*/
|
*/
|
||||||
static int mv88e61xx_busychk_multic(char *name, u32 devaddr)
|
static int mv88e61xx_busychk_multic(char *name, u32 devaddr)
|
||||||
{
|
{
|
||||||
u32 reg = 0;
|
u16 reg = 0;
|
||||||
u32 timeout = MV88E61XX_PHY_TIMEOUT;
|
u32 timeout = MV88E61XX_PHY_TIMEOUT;
|
||||||
|
|
||||||
/* Poll till SMIBusy bit is clear */
|
/* Poll till SMIBusy bit is clear */
|
||||||
|
@ -54,8 +54,7 @@ static int mv88e61xx_busychk_multic(char *name, u32 devaddr)
|
||||||
|
|
||||||
static void mv88e61xx_wr_phy(char *name, u32 phy_adr, u32 reg_ofs, u16 data)
|
static void mv88e61xx_wr_phy(char *name, u32 phy_adr, u32 reg_ofs, u16 data)
|
||||||
{
|
{
|
||||||
u16 reg;
|
u16 mii_dev_addr;
|
||||||
u32 mii_dev_addr;
|
|
||||||
|
|
||||||
/* command to read PHY dev address */
|
/* command to read PHY dev address */
|
||||||
if (miiphy_read(name, 0xEE, 0xEE, &mii_dev_addr)) {
|
if (miiphy_read(name, 0xEE, 0xEE, &mii_dev_addr)) {
|
||||||
|
@ -73,8 +72,7 @@ static void mv88e61xx_wr_phy(char *name, u32 phy_adr, u32 reg_ofs, u16 data)
|
||||||
|
|
||||||
static void mv88e61xx_rd_phy(char *name, u32 phy_adr, u32 reg_ofs, u16 * data)
|
static void mv88e61xx_rd_phy(char *name, u32 phy_adr, u32 reg_ofs, u16 * data)
|
||||||
{
|
{
|
||||||
u16 reg;
|
u16 mii_dev_addr;
|
||||||
u32 mii_dev_addr;
|
|
||||||
|
|
||||||
/* command to read PHY dev address */
|
/* command to read PHY dev address */
|
||||||
if (miiphy_read(name, 0xEE, 0xEE, &mii_dev_addr)) {
|
if (miiphy_read(name, 0xEE, 0xEE, &mii_dev_addr)) {
|
||||||
|
@ -357,15 +355,22 @@ int mv88e61xx_switch_initialize(struct mv88e61xx_config *swconfig)
|
||||||
}
|
}
|
||||||
|
|
||||||
RD_PHY(name, MV88E61XX_PRT_OFST, PHY_PHYIDR2, ®);
|
RD_PHY(name, MV88E61XX_PRT_OFST, PHY_PHYIDR2, ®);
|
||||||
reg &= 0xfff0;
|
switch (reg &= 0xfff0) {
|
||||||
if (reg == 0x1610)
|
case 0x1610:
|
||||||
idstr = "88E6161";
|
idstr = "88E6161";
|
||||||
if (reg == 0x1650)
|
break;
|
||||||
|
case 0x1650:
|
||||||
idstr = "88E6165";
|
idstr = "88E6165";
|
||||||
if (reg == 0x1210) {
|
break;
|
||||||
|
case 0x1210:
|
||||||
idstr = "88E6123";
|
idstr = "88E6123";
|
||||||
/* ports 2,3,4 not available */
|
/* ports 2,3,4 not available */
|
||||||
swconfig->ports_enabled &= 0x023;
|
swconfig->ports_enabled &= 0x023;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
/* Could not detect switch id */
|
||||||
|
idstr = "88E61??";
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Port based VLANs configuration */
|
/* Port based VLANs configuration */
|
||||||
|
|
Loading…
Reference in New Issue