diff options
author | Luka Perkov <luka@openwrt.org> | 2014-07-08 23:27:44 +0000 |
---|---|---|
committer | Luka Perkov <luka@openwrt.org> | 2014-07-08 23:27:44 +0000 |
commit | c82bb62095a0a485b58c90e94617b8253f9faeac (patch) | |
tree | e4fd6210414a630c2f0ec5714d119eb1aa8980f1 /target/linux | |
parent | 1b59aa43103e12225949642f9c53c455de4132a5 (diff) | |
download | upstream-c82bb62095a0a485b58c90e94617b8253f9faeac.tar.gz upstream-c82bb62095a0a485b58c90e94617b8253f9faeac.tar.bz2 upstream-c82bb62095a0a485b58c90e94617b8253f9faeac.zip |
kernel: ledtrig-netdev: use netdev_notifier_info
Since kernel 3.11, the third parameter passed to notifier_call()
is of type struct netdev_notifier_info. This patch fixes an oops
when setting a netdev LED trigger.
Signed-off-by: Claudio Leite <leitec@staticky.com>
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@41552 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux')
3 files changed, 31 insertions, 4 deletions
diff --git a/target/linux/generic/patches-3.12/831-ledtrig_netdev.patch b/target/linux/generic/patches-3.12/831-ledtrig_netdev.patch index 837a66908e..3ad4041a69 100644 --- a/target/linux/generic/patches-3.12/831-ledtrig_netdev.patch +++ b/target/linux/generic/patches-3.12/831-ledtrig_netdev.patch @@ -29,7 +29,16 @@ #include <linux/netdevice.h> #include <linux/timer.h> #include <linux/ctype.h> -@@ -307,8 +306,9 @@ done: +@@ -254,7 +253,7 @@ static int netdev_trig_notify(struct not + unsigned long evt, + void *dv) + { +- struct net_device *dev = dv; ++ struct net_device *dev = netdev_notifier_info_to_dev((struct netdev_notifier_info *) dv); + struct led_netdev_data *trigger_data = container_of(nb, struct led_netdev_data, notifier); + + if (evt != NETDEV_UP && evt != NETDEV_DOWN && evt != NETDEV_CHANGE && evt != NETDEV_REGISTER && evt != NETDEV_UNREGISTER) +@@ -294,8 +293,9 @@ done: static void netdev_trig_timer(unsigned long arg) { struct led_netdev_data *trigger_data = (struct led_netdev_data *)arg; @@ -40,7 +49,7 @@ write_lock(&trigger_data->lock); -@@ -318,7 +318,7 @@ static void netdev_trig_timer(unsigned l +@@ -305,7 +305,7 @@ static void netdev_trig_timer(unsigned l goto no_restart; } diff --git a/target/linux/generic/patches-3.13/831-ledtrig_netdev.patch b/target/linux/generic/patches-3.13/831-ledtrig_netdev.patch index 6884346135..77bc8cc072 100644 --- a/target/linux/generic/patches-3.13/831-ledtrig_netdev.patch +++ b/target/linux/generic/patches-3.13/831-ledtrig_netdev.patch @@ -29,7 +29,16 @@ #include <linux/netdevice.h> #include <linux/timer.h> #include <linux/ctype.h> -@@ -307,8 +306,9 @@ done: +@@ -254,7 +253,7 @@ static int netdev_trig_notify(struct not + unsigned long evt, + void *dv) + { +- struct net_device *dev = dv; ++ struct net_device *dev = netdev_notifier_info_to_dev((struct netdev_notifier_info *) dv); + struct led_netdev_data *trigger_data = container_of(nb, struct led_netdev_data, notifier); + + if (evt != NETDEV_UP && evt != NETDEV_DOWN && evt != NETDEV_CHANGE && evt != NETDEV_REGISTER && evt != NETDEV_UNREGISTER) +@@ -294,8 +293,9 @@ done: static void netdev_trig_timer(unsigned long arg) { struct led_netdev_data *trigger_data = (struct led_netdev_data *)arg; @@ -40,7 +49,7 @@ write_lock(&trigger_data->lock); -@@ -318,7 +318,7 @@ static void netdev_trig_timer(unsigned l +@@ -305,7 +305,7 @@ static void netdev_trig_timer(unsigned l goto no_restart; } diff --git a/target/linux/generic/patches-3.14/831-ledtrig_netdev.patch b/target/linux/generic/patches-3.14/831-ledtrig_netdev.patch index 1fdd6e8dc3..77bc8cc072 100644 --- a/target/linux/generic/patches-3.14/831-ledtrig_netdev.patch +++ b/target/linux/generic/patches-3.14/831-ledtrig_netdev.patch @@ -29,6 +29,15 @@ #include <linux/netdevice.h> #include <linux/timer.h> #include <linux/ctype.h> +@@ -254,7 +253,7 @@ static int netdev_trig_notify(struct not + unsigned long evt, + void *dv) + { +- struct net_device *dev = dv; ++ struct net_device *dev = netdev_notifier_info_to_dev((struct netdev_notifier_info *) dv); + struct led_netdev_data *trigger_data = container_of(nb, struct led_netdev_data, notifier); + + if (evt != NETDEV_UP && evt != NETDEV_DOWN && evt != NETDEV_CHANGE && evt != NETDEV_REGISTER && evt != NETDEV_UNREGISTER) @@ -294,8 +293,9 @@ done: static void netdev_trig_timer(unsigned long arg) { |