wwan: fix hotplug event handling
authorRozhuk Ivan <rozhuk.im@gmail.com>
Sat, 16 Nov 2019 02:11:10 +0000 (05:11 +0300)
committerHans Dedecker <dedeckeh@gmail.com>
Mon, 16 Mar 2020 20:03:25 +0000 (21:03 +0100)
Hotplug manager send: "remove" -> "add" -> "bind" events,
script interpret bind as "not add" = "remove" and mark device
as unavailable.

Signed-off-by: Rozhuk Ivan <rozhuk.im@gmail.com>
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com> [PKG_RELEASE increase]
package/network/utils/wwan/Makefile
package/network/utils/wwan/files/wwan.usbmisc

index bb829b5e2c31f2b21c5ab5e11952fb42cb30c6db..1c5a5e6669fc5d30999754a5f68fdc28b68a60ec 100644 (file)
@@ -2,7 +2,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=wwan
 PKG_VERSION:=2019-04-29
-PKG_RELEASE=4
+PKG_RELEASE=5
 
 PKG_LICENSE:=GPL-2.0
 PKG_LICENSE_FILES:=
index 4079a7fd8f6ca4c3effb5715c794b07b54e8fce5..a86ff5d98b3624272fb55abc99e87a2a13b07263 100644 (file)
@@ -17,7 +17,8 @@ find_wwan_iface() {
        [ -z "$device" -a "$proto" = wwan ] || [ "$device" = "/dev/$DEVNAME" ] || return 0
        if [ "$ACTION" = add ]; then
                proto_set_available "$cfg" 1
-       else
+       fi
+       if [ "$ACTION" = remove ]; then
                proto_set_available "$cfg" 0
        fi
        exit 0