aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorLuciano Coelho <luciano.coelho@nokia.com>2009-11-23 16:22:15 -0500
committerJohn W. Linville <linville@tuxdriver.com>2009-11-28 15:04:29 -0500
commit17d7265c7582af77357bd31884cef26f9f802313 (patch)
tree8403c70ab2921f4aed1b1a5fa0adba6d964ef85f /drivers
parent03442a33174b1d9f6f8eb8c3c2e8a9cf4b75fffe (diff)
wl1271: fix the inetdev notifier callback return values
The wl1271_dev_notify() was returning 0 or -ENODEV, when it should return NOTIFY_* instead. Now we use NOTIFY_DONE when we didn't handle the event or NOTIFY_OK when we have handled it. For inetdev notifications, it doesn't matter whether we use NOTIFY_DONE or NOTIFY_OK, because it ignores the return value of the call to blocking_notifier_call_chain(). But the notify.h header says that NOTIFY_DONE is "Don't care" and NOTIFY_OK is "Suits me", so that seems to be the right way to do it. Reported-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: Luciano Coelho <luciano.coelho@nokia.com> Reviewed-by: Juuso Oikarinen <juuso.oikarinen@nokia.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/wireless/wl12xx/wl1271_main.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/net/wireless/wl12xx/wl1271_main.c b/drivers/net/wireless/wl12xx/wl1271_main.c
index 90916ed63b45..c8652eed3677 100644
--- a/drivers/net/wireless/wl12xx/wl1271_main.c
+++ b/drivers/net/wireless/wl12xx/wl1271_main.c
@@ -815,15 +815,15 @@ static int wl1271_dev_notify(struct notifier_block *me, unsigned long what,
815 815
816 wdev = dev->ieee80211_ptr; 816 wdev = dev->ieee80211_ptr;
817 if (wdev == NULL) 817 if (wdev == NULL)
818 return -ENODEV; 818 return NOTIFY_DONE;
819 819
820 wiphy = wdev->wiphy; 820 wiphy = wdev->wiphy;
821 if (wiphy == NULL) 821 if (wiphy == NULL)
822 return -ENODEV; 822 return NOTIFY_DONE;
823 823
824 hw = wiphy_priv(wiphy); 824 hw = wiphy_priv(wiphy);
825 if (hw == NULL) 825 if (hw == NULL)
826 return -ENODEV; 826 return NOTIFY_DONE;
827 827
828 /* Check that the interface is one supported by this driver. */ 828 /* Check that the interface is one supported by this driver. */
829 wl_temp = hw->priv; 829 wl_temp = hw->priv;
@@ -832,7 +832,7 @@ static int wl1271_dev_notify(struct notifier_block *me, unsigned long what,
832 break; 832 break;
833 } 833 }
834 if (wl == NULL) 834 if (wl == NULL)
835 return -ENODEV; 835 return NOTIFY_DONE;
836 836
837 /* Get the interface IP address for the device. "ifa" will become 837 /* Get the interface IP address for the device. "ifa" will become
838 NULL if: 838 NULL if:
@@ -868,7 +868,7 @@ static int wl1271_dev_notify(struct notifier_block *me, unsigned long what,
868out: 868out:
869 mutex_unlock(&wl->mutex); 869 mutex_unlock(&wl->mutex);
870 870
871 return ret; 871 return NOTIFY_OK;
872} 872}
873 873
874static struct notifier_block wl1271_dev_notifier = { 874static struct notifier_block wl1271_dev_notifier = {