Commit 02d320c3 authored by Sergei Shtylyov's avatar Sergei Shtylyov Committed by David S. Miller

mdio_bus: coding style fixes

The recent patch from Florian Fainelli fixed all 'checkpatch.pl' errors but left
some warnings like:

- including <asm/io.h> instead of <linux/io.h>;

- including <asm/uaccess.h> instead of <linux/uaccess.h>;

- block comments using empty /* line;

- 'struct dev_pm_ops' variable not being *const*.

While fixing these, also fix the following style issues (some of which were
found running 'checkpatch.pl --strict'):

- alignment not matching open paren;

- file name in the heading comment.
Signed-off-by: default avatarSergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 2f53e904
/* /* MDIO Bus interface
* drivers/net/phy/mdio_bus.c
*
* MDIO Bus interface
* *
* Author: Andy Fleming * Author: Andy Fleming
* *
...@@ -36,10 +33,10 @@ ...@@ -36,10 +33,10 @@
#include <linux/mii.h> #include <linux/mii.h>
#include <linux/ethtool.h> #include <linux/ethtool.h>
#include <linux/phy.h> #include <linux/phy.h>
#include <linux/io.h>
#include <linux/uaccess.h>
#include <asm/io.h>
#include <asm/irq.h> #include <asm/irq.h>
#include <asm/uaccess.h>
/** /**
* mdiobus_alloc_size - allocate a mii_bus structure * mdiobus_alloc_size - allocate a mii_bus structure
...@@ -139,8 +136,7 @@ int mdiobus_register(struct mii_bus *bus) ...@@ -139,8 +136,7 @@ int mdiobus_register(struct mii_bus *bus)
int i, err; int i, err;
if (NULL == bus || NULL == bus->name || if (NULL == bus || NULL == bus->name ||
NULL == bus->read || NULL == bus->read || NULL == bus->write)
NULL == bus->write)
return -EINVAL; return -EINVAL;
BUG_ON(bus->state != MDIOBUS_ALLOCATED && BUG_ON(bus->state != MDIOBUS_ALLOCATED &&
...@@ -214,9 +210,7 @@ EXPORT_SYMBOL(mdiobus_unregister); ...@@ -214,9 +210,7 @@ EXPORT_SYMBOL(mdiobus_unregister);
*/ */
void mdiobus_free(struct mii_bus *bus) void mdiobus_free(struct mii_bus *bus)
{ {
/* /* For compatibility with error handling in drivers. */
* For compatibility with error handling in drivers.
*/
if (bus->state == MDIOBUS_ALLOCATED) { if (bus->state == MDIOBUS_ALLOCATED) {
kfree(bus); kfree(bus);
return; return;
...@@ -335,15 +329,13 @@ static bool mdio_bus_phy_may_suspend(struct phy_device *phydev) ...@@ -335,15 +329,13 @@ static bool mdio_bus_phy_may_suspend(struct phy_device *phydev)
if (!netdev) if (!netdev)
return true; return true;
/* /* Don't suspend PHY if the attched netdev parent may wakeup.
* Don't suspend PHY if the attched netdev parent may wakeup.
* The parent may point to a PCI device, as in tg3 driver. * The parent may point to a PCI device, as in tg3 driver.
*/ */
if (netdev->dev.parent && device_may_wakeup(netdev->dev.parent)) if (netdev->dev.parent && device_may_wakeup(netdev->dev.parent))
return false; return false;
/* /* Also don't suspend PHY if the netdev itself may wakeup. This
* Also don't suspend PHY if the netdev itself may wakeup. This
* is the case for devices w/o underlaying pwr. mgmt. aware bus, * is the case for devices w/o underlaying pwr. mgmt. aware bus,
* e.g. SoC devices. * e.g. SoC devices.
*/ */
...@@ -358,8 +350,7 @@ static int mdio_bus_suspend(struct device *dev) ...@@ -358,8 +350,7 @@ static int mdio_bus_suspend(struct device *dev)
struct phy_driver *phydrv = to_phy_driver(dev->driver); struct phy_driver *phydrv = to_phy_driver(dev->driver);
struct phy_device *phydev = to_phy_device(dev); struct phy_device *phydev = to_phy_device(dev);
/* /* We must stop the state machine manually, otherwise it stops out of
* We must stop the state machine manually, otherwise it stops out of
* control, possibly with the phydev->lock held. Upon resume, netdev * control, possibly with the phydev->lock held. Upon resume, netdev
* may call phy routines that try to grab the same lock, and that may * may call phy routines that try to grab the same lock, and that may
* lead to a deadlock. * lead to a deadlock.
...@@ -415,7 +406,7 @@ static int mdio_bus_restore(struct device *dev) ...@@ -415,7 +406,7 @@ static int mdio_bus_restore(struct device *dev)
return 0; return 0;
} }
static struct dev_pm_ops mdio_bus_pm_ops = { static const struct dev_pm_ops mdio_bus_pm_ops = {
.suspend = mdio_bus_suspend, .suspend = mdio_bus_suspend,
.resume = mdio_bus_resume, .resume = mdio_bus_resume,
.freeze = mdio_bus_suspend, .freeze = mdio_bus_suspend,
......
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