]> git.baikalelectronics.ru Git - kernel.git/commit
net: phy: re-design phy_modes to be self-contained
authorFlorian Fainelli <f.fainelli@gmail.com>
Wed, 12 Feb 2014 01:27:39 +0000 (17:27 -0800)
committerDavid S. Miller <davem@davemloft.net>
Thu, 13 Feb 2014 00:08:20 +0000 (19:08 -0500)
commitc003cc6c88d16ff3816b4cf01feec3ed72db7c75
tree0c01261dde720a3002a9f7a56b87b37c7c61b21b
parentcba87bb2660d5e5132757d6cb2e6c457dc898de4
net: phy: re-design phy_modes to be self-contained

of_get_phy_mode() uses a local array to map phy_interface_t values from
include/linux/net/phy.h to a string which is read from the 'phy-mode' or
'phy-connection-type' property. In preparation for exposing the PHY
interface mode through sysfs, perform the following:

- mode phy_modes from drivers/of/of_net.c to include/linux/phy.h such
  that it is right below the phy_interface_t enum
- make it a static inline function returning the string such that we can
  use it by just including include/linux/net/phy.h
- add a PHY_INTERFACE_MODE_MAX enum value to guard the iteration in
  of_get_phy_mode()

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/of/of_net.c
include/linux/phy.h