gpio-button-hotplug: cleanup, fix compiler warning
authorFelix Fietkau <nbd@openwrt.org>
Sat, 3 Aug 2013 11:56:27 +0000 (11:56 +0000)
committerFelix Fietkau <nbd@openwrt.org>
Sat, 3 Aug 2013 11:56:27 +0000 (11:56 +0000)
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
SVN-Revision: 37665

package/kernel/gpio-button-hotplug/src/gpio-button-hotplug.c

index 012cd228dc32dfe63292406be800a44437f2674d..487c813dda72614b605f3a8aba56fd0bba3dfea8 100644 (file)
@@ -128,6 +128,7 @@ static int bh_event_add_var(struct bh_event *event, int argv,
 
 static int button_hotplug_fill_event(struct bh_event *event)
 {
+       char *s;
        int ret;
 
        ret = bh_event_add_var(event, 0, "HOME=%s", "/");
@@ -139,14 +140,11 @@ static int button_hotplug_fill_event(struct bh_event *event)
        if (ret)
                return ret;
 
-       char *s;
        switch (event->type) {
-               case EV_KEY:
-                       s = "button";
-                       break;
                case EV_SW:
                        s = "switch";
                        break;
+               case EV_KEY:
                default:
                        s = "button";
                        break;