diff options
author | Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> | 2014-01-04 19:18:27 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-01-04 19:27:58 -0500 |
commit | 02d320c3e3ec076cde57558146de9e7c28e2f003 (patch) | |
tree | 763c467df3693d47dbbe5f78e763b7bb1099cd95 /drivers/net/phy | |
parent | 2f53e9047e79b638b155785f03dae8999da93bad (diff) |
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: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/phy')
-rw-r--r-- | drivers/net/phy/mdio_bus.c | 27 |
1 files changed, 9 insertions, 18 deletions
diff --git a/drivers/net/phy/mdio_bus.c b/drivers/net/phy/mdio_bus.c index 33e1c861d9ba..0ca0dfecd153 100644 --- a/drivers/net/phy/mdio_bus.c +++ b/drivers/net/phy/mdio_bus.c | |||
@@ -1,7 +1,4 @@ | |||
1 | /* | 1 | /* MDIO Bus interface |
2 | * drivers/net/phy/mdio_bus.c | ||
3 | * | ||
4 | * MDIO Bus interface | ||
5 | * | 2 | * |
6 | * Author: Andy Fleming | 3 | * Author: Andy Fleming |
7 | * | 4 | * |
@@ -36,10 +33,10 @@ | |||
36 | #include <linux/mii.h> | 33 | #include <linux/mii.h> |
37 | #include <linux/ethtool.h> | 34 | #include <linux/ethtool.h> |
38 | #include <linux/phy.h> | 35 | #include <linux/phy.h> |
36 | #include <linux/io.h> | ||
37 | #include <linux/uaccess.h> | ||
39 | 38 | ||
40 | #include <asm/io.h> | ||
41 | #include <asm/irq.h> | 39 | #include <asm/irq.h> |
42 | #include <asm/uaccess.h> | ||
43 | 40 | ||
44 | /** | 41 | /** |
45 | * mdiobus_alloc_size - allocate a mii_bus structure | 42 | * mdiobus_alloc_size - allocate a mii_bus structure |
@@ -139,8 +136,7 @@ int mdiobus_register(struct mii_bus *bus) | |||
139 | int i, err; | 136 | int i, err; |
140 | 137 | ||
141 | if (NULL == bus || NULL == bus->name || | 138 | if (NULL == bus || NULL == bus->name || |
142 | NULL == bus->read || | 139 | NULL == bus->read || NULL == bus->write) |
143 | NULL == bus->write) | ||
144 | return -EINVAL; | 140 | return -EINVAL; |
145 | 141 | ||
146 | BUG_ON(bus->state != MDIOBUS_ALLOCATED && | 142 | BUG_ON(bus->state != MDIOBUS_ALLOCATED && |
@@ -214,9 +210,7 @@ EXPORT_SYMBOL(mdiobus_unregister); | |||
214 | */ | 210 | */ |
215 | void mdiobus_free(struct mii_bus *bus) | 211 | void mdiobus_free(struct mii_bus *bus) |
216 | { | 212 | { |
217 | /* | 213 | /* For compatibility with error handling in drivers. */ |
218 | * For compatibility with error handling in drivers. | ||
219 | */ | ||
220 | if (bus->state == MDIOBUS_ALLOCATED) { | 214 | if (bus->state == MDIOBUS_ALLOCATED) { |
221 | kfree(bus); | 215 | kfree(bus); |
222 | return; | 216 | return; |
@@ -335,15 +329,13 @@ static bool mdio_bus_phy_may_suspend(struct phy_device *phydev) | |||
335 | if (!netdev) | 329 | if (!netdev) |
336 | return true; | 330 | return true; |
337 | 331 | ||
338 | /* | 332 | /* Don't suspend PHY if the attched netdev parent may wakeup. |
339 | * Don't suspend PHY if the attched netdev parent may wakeup. | ||
340 | * The parent may point to a PCI device, as in tg3 driver. | 333 | * The parent may point to a PCI device, as in tg3 driver. |
341 | */ | 334 | */ |
342 | if (netdev->dev.parent && device_may_wakeup(netdev->dev.parent)) | 335 | if (netdev->dev.parent && device_may_wakeup(netdev->dev.parent)) |
343 | return false; | 336 | return false; |
344 | 337 | ||
345 | /* | 338 | /* Also don't suspend PHY if the netdev itself may wakeup. This |
346 | * Also don't suspend PHY if the netdev itself may wakeup. This | ||
347 | * is the case for devices w/o underlaying pwr. mgmt. aware bus, | 339 | * is the case for devices w/o underlaying pwr. mgmt. aware bus, |
348 | * e.g. SoC devices. | 340 | * e.g. SoC devices. |
349 | */ | 341 | */ |
@@ -358,8 +350,7 @@ static int mdio_bus_suspend(struct device *dev) | |||
358 | struct phy_driver *phydrv = to_phy_driver(dev->driver); | 350 | struct phy_driver *phydrv = to_phy_driver(dev->driver); |
359 | struct phy_device *phydev = to_phy_device(dev); | 351 | struct phy_device *phydev = to_phy_device(dev); |
360 | 352 | ||
361 | /* | 353 | /* We must stop the state machine manually, otherwise it stops out of |
362 | * We must stop the state machine manually, otherwise it stops out of | ||
363 | * control, possibly with the phydev->lock held. Upon resume, netdev | 354 | * control, possibly with the phydev->lock held. Upon resume, netdev |
364 | * may call phy routines that try to grab the same lock, and that may | 355 | * may call phy routines that try to grab the same lock, and that may |
365 | * lead to a deadlock. | 356 | * lead to a deadlock. |
@@ -415,7 +406,7 @@ static int mdio_bus_restore(struct device *dev) | |||
415 | return 0; | 406 | return 0; |
416 | } | 407 | } |
417 | 408 | ||
418 | static struct dev_pm_ops mdio_bus_pm_ops = { | 409 | static const struct dev_pm_ops mdio_bus_pm_ops = { |
419 | .suspend = mdio_bus_suspend, | 410 | .suspend = mdio_bus_suspend, |
420 | .resume = mdio_bus_resume, | 411 | .resume = mdio_bus_resume, |
421 | .freeze = mdio_bus_suspend, | 412 | .freeze = mdio_bus_suspend, |