Skip to content

Commit

Permalink
net: phy: change format of some declarations
Browse files Browse the repository at this point in the history
Add a blank line after declarations, change the order of them and put the
assignments and declarations together.

Cc: Richard Cochran <[email protected]>
Signed-off-by: Wenpeng Liang <[email protected]>
Signed-off-by: Weihang Li <[email protected]>
Reviewed-by: Andrew Lunn <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
Wenpeng Liang authored and davem330 committed Jun 16, 2021
1 parent 56a967c commit 775f254
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 5 deletions.
4 changes: 2 additions & 2 deletions drivers/net/phy/bcm87xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ static int bcm87xx_of_reg_init(struct phy_device *phydev)
u16 reg = be32_to_cpup(paddr++);
u16 mask = be32_to_cpup(paddr++);
u16 val_bits = be32_to_cpup(paddr++);
int val;
u32 regnum = mdiobus_c45_addr(devid, reg);
val = 0;
int val = 0;

if (mask) {
val = phy_read(phydev, regnum);
if (val < 0) {
Expand Down
1 change: 1 addition & 0 deletions drivers/net/phy/dp83640.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
int val;

phy_write(phydev, PAGESEL, 0);
val = phy_read(phydev, PHYCR2);
if (on)
Expand Down
7 changes: 4 additions & 3 deletions drivers/net/phy/et1011c.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ MODULE_LICENSE("GPL");

static int et1011c_config_aneg(struct phy_device *phydev)
{
int ctl = 0;
ctl = phy_read(phydev, MII_BMCR);
int ctl = phy_read(phydev, MII_BMCR);

if (ctl < 0)
return ctl;
ctl &= ~(BMCR_FULLDPLX | BMCR_SPEED100 | BMCR_SPEED1000 |
Expand All @@ -60,9 +60,10 @@ static int et1011c_config_aneg(struct phy_device *phydev)

static int et1011c_read_status(struct phy_device *phydev)
{
static int speed;
int ret;
u32 val;
static int speed;

ret = genphy_read_status(phydev);

if (speed != phydev->speed) {
Expand Down
1 change: 1 addition & 0 deletions drivers/net/phy/mdio_bus.c
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ EXPORT_SYMBOL(mdiobus_alloc_size);
static void mdiobus_release(struct device *d)
{
struct mii_bus *bus = to_mii_bus(d);

BUG_ON(bus->state != MDIOBUS_RELEASED &&
/* for compatibility with error handling in drivers */
bus->state != MDIOBUS_ALLOCATED);
Expand Down
1 change: 1 addition & 0 deletions drivers/net/phy/qsemi.c
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ static int qs6612_ack_interrupt(struct phy_device *phydev)
static int qs6612_config_intr(struct phy_device *phydev)
{
int err;

if (phydev->interrupts == PHY_INTERRUPT_ENABLED) {
/* clear any interrupts before enabling them */
err = qs6612_ack_interrupt(phydev);
Expand Down

0 comments on commit 775f254

Please sign in to comment.