提交 77051ed8 编写于 作者: S Sergei Shtylyov 提交者: David S. Miller

phy: kill excess empty lines

Remove excess empty lines such as those between a function call and its result
check and just duplicate ones between functions.
Signed-off-by: NSergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 553fe92b
...@@ -384,7 +384,6 @@ int phy_start_aneg(struct phy_device *phydev) ...@@ -384,7 +384,6 @@ int phy_start_aneg(struct phy_device *phydev)
phy_sanitize_settings(phydev); phy_sanitize_settings(phydev);
err = phydev->drv->config_aneg(phydev); err = phydev->drv->config_aneg(phydev);
if (err < 0) if (err < 0)
goto out_unlock; goto out_unlock;
...@@ -404,7 +403,6 @@ int phy_start_aneg(struct phy_device *phydev) ...@@ -404,7 +403,6 @@ int phy_start_aneg(struct phy_device *phydev)
} }
EXPORT_SYMBOL(phy_start_aneg); EXPORT_SYMBOL(phy_start_aneg);
/** /**
* phy_start_machine - start PHY state machine tracking * phy_start_machine - start PHY state machine tracking
* @phydev: the phy_device struct * @phydev: the phy_device struct
...@@ -514,13 +512,11 @@ static int phy_disable_interrupts(struct phy_device *phydev) ...@@ -514,13 +512,11 @@ static int phy_disable_interrupts(struct phy_device *phydev)
/* Disable PHY interrupts */ /* Disable PHY interrupts */
err = phy_config_interrupt(phydev, PHY_INTERRUPT_DISABLED); err = phy_config_interrupt(phydev, PHY_INTERRUPT_DISABLED);
if (err) if (err)
goto phy_err; goto phy_err;
/* Clear the interrupt */ /* Clear the interrupt */
err = phy_clear_interrupt(phydev); err = phy_clear_interrupt(phydev);
if (err) if (err)
goto phy_err; goto phy_err;
...@@ -589,7 +585,6 @@ int phy_stop_interrupts(struct phy_device *phydev) ...@@ -589,7 +585,6 @@ int phy_stop_interrupts(struct phy_device *phydev)
} }
EXPORT_SYMBOL(phy_stop_interrupts); EXPORT_SYMBOL(phy_stop_interrupts);
/** /**
* phy_change - Scheduled by the phy_interrupt/timer to handle PHY changes * phy_change - Scheduled by the phy_interrupt/timer to handle PHY changes
* @work: work_struct that describes the work to be done * @work: work_struct that describes the work to be done
...@@ -622,7 +617,6 @@ void phy_change(struct work_struct *work) ...@@ -622,7 +617,6 @@ void phy_change(struct work_struct *work)
/* reschedule state queue work to run as soon as possible */ /* reschedule state queue work to run as soon as possible */
cancel_delayed_work_sync(&phydev->state_queue); cancel_delayed_work_sync(&phydev->state_queue);
queue_delayed_work(system_power_efficient_wq, &phydev->state_queue, 0); queue_delayed_work(system_power_efficient_wq, &phydev->state_queue, 0);
return; return;
ignore: ignore:
...@@ -668,7 +662,6 @@ void phy_stop(struct phy_device *phydev) ...@@ -668,7 +662,6 @@ void phy_stop(struct phy_device *phydev)
} }
EXPORT_SYMBOL(phy_stop); EXPORT_SYMBOL(phy_stop);
/** /**
* phy_start - start or restart a PHY device * phy_start - start or restart a PHY device
* @phydev: target phy_device struct * @phydev: target phy_device struct
...@@ -730,7 +723,6 @@ void phy_state_machine(struct work_struct *work) ...@@ -730,7 +723,6 @@ void phy_state_machine(struct work_struct *work)
break; break;
case PHY_AN: case PHY_AN:
err = phy_read_status(phydev); err = phy_read_status(phydev);
if (err < 0) if (err < 0)
break; break;
...@@ -762,7 +754,6 @@ void phy_state_machine(struct work_struct *work) ...@@ -762,7 +754,6 @@ void phy_state_machine(struct work_struct *work)
break; break;
case PHY_NOLINK: case PHY_NOLINK:
err = phy_read_status(phydev); err = phy_read_status(phydev);
if (err) if (err)
break; break;
...@@ -774,7 +765,6 @@ void phy_state_machine(struct work_struct *work) ...@@ -774,7 +765,6 @@ void phy_state_machine(struct work_struct *work)
break; break;
case PHY_FORCING: case PHY_FORCING:
err = genphy_update_link(phydev); err = genphy_update_link(phydev);
if (err) if (err)
break; break;
...@@ -797,7 +787,6 @@ void phy_state_machine(struct work_struct *work) ...@@ -797,7 +787,6 @@ void phy_state_machine(struct work_struct *work)
break; break;
case PHY_CHANGELINK: case PHY_CHANGELINK:
err = phy_read_status(phydev); err = phy_read_status(phydev);
if (err) if (err)
break; break;
...@@ -824,14 +813,11 @@ void phy_state_machine(struct work_struct *work) ...@@ -824,14 +813,11 @@ void phy_state_machine(struct work_struct *work)
} }
break; break;
case PHY_RESUMING: case PHY_RESUMING:
err = phy_clear_interrupt(phydev); err = phy_clear_interrupt(phydev);
if (err) if (err)
break; break;
err = phy_config_interrupt(phydev, PHY_INTERRUPT_ENABLED); err = phy_config_interrupt(phydev, PHY_INTERRUPT_ENABLED);
if (err) if (err)
break; break;
......
...@@ -151,7 +151,6 @@ struct phy_device *phy_device_create(struct mii_bus *bus, int addr, int phy_id, ...@@ -151,7 +151,6 @@ struct phy_device *phy_device_create(struct mii_bus *bus, int addr, int phy_id,
/* We allocate the device, and initialize the default values */ /* We allocate the device, and initialize the default values */
dev = kzalloc(sizeof(*dev), GFP_KERNEL); dev = kzalloc(sizeof(*dev), GFP_KERNEL);
if (NULL == dev) if (NULL == dev)
return (struct phy_device *)PTR_ERR((void *)-ENOMEM); return (struct phy_device *)PTR_ERR((void *)-ENOMEM);
...@@ -294,7 +293,6 @@ static int get_phy_id(struct mii_bus *bus, int addr, u32 *phy_id, ...@@ -294,7 +293,6 @@ static int get_phy_id(struct mii_bus *bus, int addr, u32 *phy_id,
/* Grab the bits from PHYIR1, and put them in the upper half */ /* Grab the bits from PHYIR1, and put them in the upper half */
phy_reg = mdiobus_read(bus, addr, MII_PHYSID1); phy_reg = mdiobus_read(bus, addr, MII_PHYSID1);
if (phy_reg < 0) if (phy_reg < 0)
return -EIO; return -EIO;
...@@ -302,7 +300,6 @@ static int get_phy_id(struct mii_bus *bus, int addr, u32 *phy_id, ...@@ -302,7 +300,6 @@ static int get_phy_id(struct mii_bus *bus, int addr, u32 *phy_id,
/* Grab the bits from PHYIR2, and put them in the lower half */ /* Grab the bits from PHYIR2, and put them in the lower half */
phy_reg = mdiobus_read(bus, addr, MII_PHYSID2); phy_reg = mdiobus_read(bus, addr, MII_PHYSID2);
if (phy_reg < 0) if (phy_reg < 0)
return -EIO; return -EIO;
...@@ -724,7 +721,6 @@ static int genphy_config_advert(struct phy_device *phydev) ...@@ -724,7 +721,6 @@ static int genphy_config_advert(struct phy_device *phydev)
/* Setup standard advertisement */ /* Setup standard advertisement */
adv = phy_read(phydev, MII_ADVERTISE); adv = phy_read(phydev, MII_ADVERTISE);
if (adv < 0) if (adv < 0)
return adv; return adv;
...@@ -745,7 +741,6 @@ static int genphy_config_advert(struct phy_device *phydev) ...@@ -745,7 +741,6 @@ static int genphy_config_advert(struct phy_device *phydev)
if (phydev->supported & (SUPPORTED_1000baseT_Half | if (phydev->supported & (SUPPORTED_1000baseT_Half |
SUPPORTED_1000baseT_Full)) { SUPPORTED_1000baseT_Full)) {
adv = phy_read(phydev, MII_CTRL1000); adv = phy_read(phydev, MII_CTRL1000);
if (adv < 0) if (adv < 0)
return adv; return adv;
...@@ -812,7 +807,6 @@ int genphy_restart_aneg(struct phy_device *phydev) ...@@ -812,7 +807,6 @@ int genphy_restart_aneg(struct phy_device *phydev)
} }
EXPORT_SYMBOL(genphy_restart_aneg); EXPORT_SYMBOL(genphy_restart_aneg);
/** /**
* genphy_config_aneg - restart auto-negotiation or write BMCR * genphy_config_aneg - restart auto-negotiation or write BMCR
* @phydev: target phy_device struct * @phydev: target phy_device struct
...@@ -829,10 +823,8 @@ int genphy_config_aneg(struct phy_device *phydev) ...@@ -829,10 +823,8 @@ int genphy_config_aneg(struct phy_device *phydev)
return genphy_setup_forced(phydev); return genphy_setup_forced(phydev);
result = genphy_config_advert(phydev); result = genphy_config_advert(phydev);
if (result < 0) /* error */ if (result < 0) /* error */
return result; return result;
if (result == 0) { if (result == 0) {
/* Advertisement hasn't changed, but maybe aneg was never on to /* Advertisement hasn't changed, but maybe aneg was never on to
* begin with? Or maybe phy was isolated? * begin with? Or maybe phy was isolated?
...@@ -870,13 +862,11 @@ int genphy_update_link(struct phy_device *phydev) ...@@ -870,13 +862,11 @@ int genphy_update_link(struct phy_device *phydev)
/* Do a fake read */ /* Do a fake read */
status = phy_read(phydev, MII_BMSR); status = phy_read(phydev, MII_BMSR);
if (status < 0) if (status < 0)
return status; return status;
/* Read link and autonegotiation status */ /* Read link and autonegotiation status */
status = phy_read(phydev, MII_BMSR); status = phy_read(phydev, MII_BMSR);
if (status < 0) if (status < 0)
return status; return status;
...@@ -916,12 +906,10 @@ int genphy_read_status(struct phy_device *phydev) ...@@ -916,12 +906,10 @@ int genphy_read_status(struct phy_device *phydev)
if (phydev->supported & (SUPPORTED_1000baseT_Half if (phydev->supported & (SUPPORTED_1000baseT_Half
| SUPPORTED_1000baseT_Full)) { | SUPPORTED_1000baseT_Full)) {
lpagb = phy_read(phydev, MII_STAT1000); lpagb = phy_read(phydev, MII_STAT1000);
if (lpagb < 0) if (lpagb < 0)
return lpagb; return lpagb;
adv = phy_read(phydev, MII_CTRL1000); adv = phy_read(phydev, MII_CTRL1000);
if (adv < 0) if (adv < 0)
return adv; return adv;
...@@ -931,14 +919,12 @@ int genphy_read_status(struct phy_device *phydev) ...@@ -931,14 +919,12 @@ int genphy_read_status(struct phy_device *phydev)
} }
lpa = phy_read(phydev, MII_LPA); lpa = phy_read(phydev, MII_LPA);
if (lpa < 0) if (lpa < 0)
return lpa; return lpa;
phydev->lp_advertising |= mii_lpa_to_ethtool_lpa_t(lpa); phydev->lp_advertising |= mii_lpa_to_ethtool_lpa_t(lpa);
adv = phy_read(phydev, MII_ADVERTISE); adv = phy_read(phydev, MII_ADVERTISE);
if (adv < 0) if (adv < 0)
return adv; return adv;
...@@ -1007,7 +993,6 @@ static int genphy_config_init(struct phy_device *phydev) ...@@ -1007,7 +993,6 @@ static int genphy_config_init(struct phy_device *phydev)
/* Do we support autonegotiation? */ /* Do we support autonegotiation? */
val = phy_read(phydev, MII_BMSR); val = phy_read(phydev, MII_BMSR);
if (val < 0) if (val < 0)
return val; return val;
...@@ -1025,7 +1010,6 @@ static int genphy_config_init(struct phy_device *phydev) ...@@ -1025,7 +1010,6 @@ static int genphy_config_init(struct phy_device *phydev)
if (val & BMSR_ESTATEN) { if (val & BMSR_ESTATEN) {
val = phy_read(phydev, MII_ESTATUS); val = phy_read(phydev, MII_ESTATUS);
if (val < 0) if (val < 0)
return val; return val;
...@@ -1146,7 +1130,6 @@ int phy_driver_register(struct phy_driver *new_driver) ...@@ -1146,7 +1130,6 @@ int phy_driver_register(struct phy_driver *new_driver)
new_driver->driver.remove = phy_remove; new_driver->driver.remove = phy_remove;
retval = driver_register(&new_driver->driver); retval = driver_register(&new_driver->driver);
if (retval) { if (retval) {
pr_err("%s: Error %d in registering driver\n", pr_err("%s: Error %d in registering driver\n",
new_driver->name, retval); new_driver->name, retval);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册