diff options
| -rw-r--r-- | drivers/net/dsa/bcm_sf2.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/net/dsa/bcm_sf2.c b/drivers/net/dsa/bcm_sf2.c index 17ec32b0a1cc..14138d423cf1 100644 --- a/drivers/net/dsa/bcm_sf2.c +++ b/drivers/net/dsa/bcm_sf2.c | |||
| @@ -726,10 +726,11 @@ static void bcm_sf2_sw_get_wol(struct dsa_switch *ds, int port, | |||
| 726 | { | 726 | { |
| 727 | struct net_device *p = ds->ports[port].cpu_dp->master; | 727 | struct net_device *p = ds->ports[port].cpu_dp->master; |
| 728 | struct bcm_sf2_priv *priv = bcm_sf2_to_priv(ds); | 728 | struct bcm_sf2_priv *priv = bcm_sf2_to_priv(ds); |
| 729 | struct ethtool_wolinfo pwol; | 729 | struct ethtool_wolinfo pwol = { }; |
| 730 | 730 | ||
| 731 | /* Get the parent device WoL settings */ | 731 | /* Get the parent device WoL settings */ |
| 732 | p->ethtool_ops->get_wol(p, &pwol); | 732 | if (p->ethtool_ops->get_wol) |
| 733 | p->ethtool_ops->get_wol(p, &pwol); | ||
| 733 | 734 | ||
| 734 | /* Advertise the parent device supported settings */ | 735 | /* Advertise the parent device supported settings */ |
| 735 | wol->supported = pwol.supported; | 736 | wol->supported = pwol.supported; |
| @@ -750,9 +751,10 @@ static int bcm_sf2_sw_set_wol(struct dsa_switch *ds, int port, | |||
| 750 | struct net_device *p = ds->ports[port].cpu_dp->master; | 751 | struct net_device *p = ds->ports[port].cpu_dp->master; |
| 751 | struct bcm_sf2_priv *priv = bcm_sf2_to_priv(ds); | 752 | struct bcm_sf2_priv *priv = bcm_sf2_to_priv(ds); |
| 752 | s8 cpu_port = ds->ports[port].cpu_dp->index; | 753 | s8 cpu_port = ds->ports[port].cpu_dp->index; |
| 753 | struct ethtool_wolinfo pwol; | 754 | struct ethtool_wolinfo pwol = { }; |
| 754 | 755 | ||
| 755 | p->ethtool_ops->get_wol(p, &pwol); | 756 | if (p->ethtool_ops->get_wol) |
| 757 | p->ethtool_ops->get_wol(p, &pwol); | ||
| 756 | if (wol->wolopts & ~pwol.supported) | 758 | if (wol->wolopts & ~pwol.supported) |
| 757 | return -EINVAL; | 759 | return -EINVAL; |
| 758 | 760 | ||
