Commit 516b29ed authored by Florian Fainelli's avatar Florian Fainelli Committed by David S. Miller

net: phy: Cosmetic fixes to phylink/sfp/sfp-bus.c

Perform a number of stylistic changes to phylink.c, sfp.c and sfp-bus.c:

- align with netdev-style comments
- align function arguments to the opening parenthesis
- remove blank lines
- fixup a few lines over 80 columns
Signed-off-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 2e39748a
...@@ -506,7 +506,8 @@ static int phylink_register_sfp(struct phylink *pl, struct device_node *np) ...@@ -506,7 +506,8 @@ static int phylink_register_sfp(struct phylink *pl, struct device_node *np)
} }
struct phylink *phylink_create(struct net_device *ndev, struct device_node *np, struct phylink *phylink_create(struct net_device *ndev, struct device_node *np,
phy_interface_t iface, const struct phylink_mac_ops *ops) phy_interface_t iface,
const struct phylink_mac_ops *ops)
{ {
struct phylink *pl; struct phylink *pl;
int ret; int ret;
...@@ -1337,8 +1338,6 @@ int phylink_mii_ioctl(struct phylink *pl, struct ifreq *ifr, int cmd) ...@@ -1337,8 +1338,6 @@ int phylink_mii_ioctl(struct phylink *pl, struct ifreq *ifr, int cmd)
} }
EXPORT_SYMBOL_GPL(phylink_mii_ioctl); EXPORT_SYMBOL_GPL(phylink_mii_ioctl);
static int phylink_sfp_module_insert(void *upstream, static int phylink_sfp_module_insert(void *upstream,
const struct sfp_eeprom_id *id) const struct sfp_eeprom_id *id)
{ {
......
...@@ -26,7 +26,6 @@ struct sfp_bus { ...@@ -26,7 +26,6 @@ struct sfp_bus {
bool started; bool started;
}; };
int sfp_parse_port(struct sfp_bus *bus, const struct sfp_eeprom_id *id, int sfp_parse_port(struct sfp_bus *bus, const struct sfp_eeprom_id *id,
unsigned long *support) unsigned long *support)
{ {
...@@ -208,7 +207,6 @@ void sfp_parse_support(struct sfp_bus *bus, const struct sfp_eeprom_id *id, ...@@ -208,7 +207,6 @@ void sfp_parse_support(struct sfp_bus *bus, const struct sfp_eeprom_id *id,
} }
EXPORT_SYMBOL_GPL(sfp_parse_support); EXPORT_SYMBOL_GPL(sfp_parse_support);
static LIST_HEAD(sfp_buses); static LIST_HEAD(sfp_buses);
static DEFINE_MUTEX(sfp_mutex); static DEFINE_MUTEX(sfp_mutex);
...@@ -295,7 +293,6 @@ static void sfp_unregister_bus(struct sfp_bus *bus) ...@@ -295,7 +293,6 @@ static void sfp_unregister_bus(struct sfp_bus *bus)
bus->registered = false; bus->registered = false;
} }
int sfp_get_module_info(struct sfp_bus *bus, struct ethtool_modinfo *modinfo) int sfp_get_module_info(struct sfp_bus *bus, struct ethtool_modinfo *modinfo)
{ {
if (!bus->registered) if (!bus->registered)
...@@ -368,7 +365,6 @@ void sfp_unregister_upstream(struct sfp_bus *bus) ...@@ -368,7 +365,6 @@ void sfp_unregister_upstream(struct sfp_bus *bus)
} }
EXPORT_SYMBOL_GPL(sfp_unregister_upstream); EXPORT_SYMBOL_GPL(sfp_unregister_upstream);
/* Socket driver entry points */ /* Socket driver entry points */
int sfp_add_phy(struct sfp_bus *bus, struct phy_device *phydev) int sfp_add_phy(struct sfp_bus *bus, struct phy_device *phydev)
{ {
...@@ -395,7 +391,6 @@ void sfp_remove_phy(struct sfp_bus *bus) ...@@ -395,7 +391,6 @@ void sfp_remove_phy(struct sfp_bus *bus)
} }
EXPORT_SYMBOL_GPL(sfp_remove_phy); EXPORT_SYMBOL_GPL(sfp_remove_phy);
void sfp_link_up(struct sfp_bus *bus) void sfp_link_up(struct sfp_bus *bus)
{ {
const struct sfp_upstream_ops *ops = sfp_get_upstream_ops(bus); const struct sfp_upstream_ops *ops = sfp_get_upstream_ops(bus);
......
...@@ -88,15 +88,12 @@ static const enum gpiod_flags gpio_flags[] = { ...@@ -88,15 +88,12 @@ static const enum gpiod_flags gpio_flags[] = {
#define T_PROBE_INIT msecs_to_jiffies(300) #define T_PROBE_INIT msecs_to_jiffies(300)
#define T_PROBE_RETRY msecs_to_jiffies(100) #define T_PROBE_RETRY msecs_to_jiffies(100)
/* /* SFP modules appear to always have their PHY configured for bus address
* SFP modules appear to always have their PHY configured for bus address
* 0x56 (which with mdio-i2c, translates to a PHY address of 22). * 0x56 (which with mdio-i2c, translates to a PHY address of 22).
*/ */
#define SFP_PHY_ADDR 22 #define SFP_PHY_ADDR 22
/* /* Give this long for the PHY to reset. */
* Give this long for the PHY to reset.
*/
#define T_PHY_RESET_MS 50 #define T_PHY_RESET_MS 50
static DEFINE_MUTEX(sfp_mutex); static DEFINE_MUTEX(sfp_mutex);
...@@ -220,7 +217,6 @@ static int sfp_i2c_configure(struct sfp *sfp, struct i2c_adapter *i2c) ...@@ -220,7 +217,6 @@ static int sfp_i2c_configure(struct sfp *sfp, struct i2c_adapter *i2c)
return 0; return 0;
} }
/* Interface */ /* Interface */
static unsigned int sfp_get_state(struct sfp *sfp) static unsigned int sfp_get_state(struct sfp *sfp)
{ {
...@@ -295,7 +291,8 @@ static void sfp_sm_next(struct sfp *sfp, unsigned int state, ...@@ -295,7 +291,8 @@ static void sfp_sm_next(struct sfp *sfp, unsigned int state,
sfp_sm_set_timer(sfp, timeout); sfp_sm_set_timer(sfp, timeout);
} }
static void sfp_sm_ins_next(struct sfp *sfp, unsigned int state, unsigned int timeout) static void sfp_sm_ins_next(struct sfp *sfp, unsigned int state,
unsigned int timeout)
{ {
sfp->sm_mod_state = state; sfp->sm_mod_state = state;
sfp_sm_set_timer(sfp, timeout); sfp_sm_set_timer(sfp, timeout);
...@@ -370,7 +367,8 @@ static void sfp_sm_link_check_los(struct sfp *sfp) ...@@ -370,7 +367,8 @@ static void sfp_sm_link_check_los(struct sfp *sfp)
static void sfp_sm_fault(struct sfp *sfp, bool warn) static void sfp_sm_fault(struct sfp *sfp, bool warn)
{ {
if (sfp->sm_retries && !--sfp->sm_retries) { if (sfp->sm_retries && !--sfp->sm_retries) {
dev_err(sfp->dev, "module persistently indicates fault, disabling\n"); dev_err(sfp->dev,
"module persistently indicates fault, disabling\n");
sfp_sm_next(sfp, SFP_S_TX_DISABLE, 0); sfp_sm_next(sfp, SFP_S_TX_DISABLE, 0);
} else { } else {
if (warn) if (warn)
...@@ -461,7 +459,8 @@ static int sfp_sm_mod_probe(struct sfp *sfp) ...@@ -461,7 +459,8 @@ static int sfp_sm_mod_probe(struct sfp *sfp)
memcpy(date, sfp->id.ext.datecode, 8); memcpy(date, sfp->id.ext.datecode, 8);
date[8] = '\0'; date[8] = '\0';
dev_info(sfp->dev, "module %s %s rev %s sn %s dc %s\n", vendor, part, rev, sn, date); dev_info(sfp->dev, "module %s %s rev %s sn %s dc %s\n",
vendor, part, rev, sn, date);
/* We only support SFP modules, not the legacy GBIC modules. */ /* We only support SFP modules, not the legacy GBIC modules. */
if (sfp->id.base.phys_id != SFP_PHYS_ID_SFP || if (sfp->id.base.phys_id != SFP_PHYS_ID_SFP ||
......
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