]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
net: make vlan ndo_vlan_rx_[add/kill]_vid return error value
authorJiri Pirko <jpirko@redhat.com>
Fri, 9 Dec 2011 00:52:37 +0000 (19:52 -0500)
committerMaxim Uvarov <maxim.uvarov@oracle.com>
Mon, 7 May 2012 21:44:04 +0000 (14:44 -0700)
Let caller know the result of adding/removing vlan id to/from vlan
filter.

In some drivers I make those functions to just return 0. But in those
where there is able to see if hw setup went correctly, return value is
set appropriately.

Signed-off-by: Jiri Pirko <jpirko@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/benet/be_main.c

index 747b198f628c605583a5df6c95f2f369ccf15e21..2ead1513b286b58ec70eef38a72600c9a72af712 100644 (file)
@@ -779,31 +779,35 @@ static int be_vid_config(struct be_adapter *adapter, bool vf, u32 vf_num)
        return status;
 }
 
-static void be_vlan_add_vid(struct net_device *netdev, u16 vid)
+static int be_vlan_add_vid(struct net_device *netdev, u16 vid)
 {
        struct be_adapter *adapter = netdev_priv(netdev);
 
        adapter->vlans_added++;
        if (!be_physfn(adapter))
-               return;
+               return 0;
 
        adapter->vlan_tag[vid] = 1;
        if (adapter->vlans_added <= (adapter->max_vlans + 1))
                be_vid_config(adapter, false, 0);
+
+       return 0;
 }
 
-static void be_vlan_rem_vid(struct net_device *netdev, u16 vid)
+static int be_vlan_rem_vid(struct net_device *netdev, u16 vid)
 {
        struct be_adapter *adapter = netdev_priv(netdev);
 
        adapter->vlans_added--;
 
        if (!be_physfn(adapter))
-               return;
+               return 0;
 
        adapter->vlan_tag[vid] = 0;
        if (adapter->vlans_added <= adapter->max_vlans)
                be_vid_config(adapter, false, 0);
+
+       return 0;
 }
 
 static void be_set_rx_mode(struct net_device *netdev)