Commit 775f2547 authored by Wenpeng Liang's avatar Wenpeng Liang Committed by David S. Miller

net: phy: change format of some declarations

Add a blank line after declarations, change the order of them and put the
assignments and declarations together.

Cc: Richard Cochran <richardcochran@gmail.com>
Signed-off-by: default avatarWenpeng Liang <liangwenpeng@huawei.com>
Signed-off-by: default avatarWeihang Li <liweihang@huawei.com>
Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 56a967c4
...@@ -54,9 +54,9 @@ static int bcm87xx_of_reg_init(struct phy_device *phydev) ...@@ -54,9 +54,9 @@ static int bcm87xx_of_reg_init(struct phy_device *phydev)
u16 reg = be32_to_cpup(paddr++); u16 reg = be32_to_cpup(paddr++);
u16 mask = be32_to_cpup(paddr++); u16 mask = be32_to_cpup(paddr++);
u16 val_bits = be32_to_cpup(paddr++); u16 val_bits = be32_to_cpup(paddr++);
int val;
u32 regnum = mdiobus_c45_addr(devid, reg); u32 regnum = mdiobus_c45_addr(devid, reg);
val = 0; int val = 0;
if (mask) { if (mask) {
val = phy_read(phydev, regnum); val = phy_read(phydev, regnum);
if (val < 0) { if (val < 0) {
......
...@@ -615,6 +615,7 @@ static void prune_rx_ts(struct dp83640_private *dp83640) ...@@ -615,6 +615,7 @@ static void prune_rx_ts(struct dp83640_private *dp83640)
static void enable_broadcast(struct phy_device *phydev, int init_page, int on) static void enable_broadcast(struct phy_device *phydev, int init_page, int on)
{ {
int val; int val;
phy_write(phydev, PAGESEL, 0); phy_write(phydev, PAGESEL, 0);
val = phy_read(phydev, PHYCR2); val = phy_read(phydev, PHYCR2);
if (on) if (on)
......
...@@ -46,8 +46,8 @@ MODULE_LICENSE("GPL"); ...@@ -46,8 +46,8 @@ MODULE_LICENSE("GPL");
static int et1011c_config_aneg(struct phy_device *phydev) static int et1011c_config_aneg(struct phy_device *phydev)
{ {
int ctl = 0; int ctl = phy_read(phydev, MII_BMCR);
ctl = phy_read(phydev, MII_BMCR);
if (ctl < 0) if (ctl < 0)
return ctl; return ctl;
ctl &= ~(BMCR_FULLDPLX | BMCR_SPEED100 | BMCR_SPEED1000 | ctl &= ~(BMCR_FULLDPLX | BMCR_SPEED100 | BMCR_SPEED1000 |
...@@ -60,9 +60,10 @@ static int et1011c_config_aneg(struct phy_device *phydev) ...@@ -60,9 +60,10 @@ static int et1011c_config_aneg(struct phy_device *phydev)
static int et1011c_read_status(struct phy_device *phydev) static int et1011c_read_status(struct phy_device *phydev)
{ {
static int speed;
int ret; int ret;
u32 val; u32 val;
static int speed;
ret = genphy_read_status(phydev); ret = genphy_read_status(phydev);
if (speed != phydev->speed) { if (speed != phydev->speed) {
......
...@@ -175,6 +175,7 @@ EXPORT_SYMBOL(mdiobus_alloc_size); ...@@ -175,6 +175,7 @@ EXPORT_SYMBOL(mdiobus_alloc_size);
static void mdiobus_release(struct device *d) static void mdiobus_release(struct device *d)
{ {
struct mii_bus *bus = to_mii_bus(d); struct mii_bus *bus = to_mii_bus(d);
BUG_ON(bus->state != MDIOBUS_RELEASED && BUG_ON(bus->state != MDIOBUS_RELEASED &&
/* for compatibility with error handling in drivers */ /* for compatibility with error handling in drivers */
bus->state != MDIOBUS_ALLOCATED); bus->state != MDIOBUS_ALLOCATED);
......
...@@ -100,6 +100,7 @@ static int qs6612_ack_interrupt(struct phy_device *phydev) ...@@ -100,6 +100,7 @@ static int qs6612_ack_interrupt(struct phy_device *phydev)
static int qs6612_config_intr(struct phy_device *phydev) static int qs6612_config_intr(struct phy_device *phydev)
{ {
int err; int err;
if (phydev->interrupts == PHY_INTERRUPT_ENABLED) { if (phydev->interrupts == PHY_INTERRUPT_ENABLED) {
/* clear any interrupts before enabling them */ /* clear any interrupts before enabling them */
err = qs6612_ack_interrupt(phydev); err = qs6612_ack_interrupt(phydev);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment