Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3317fad5 authored by Magnus Damm's avatar Magnus Damm Committed by Greg Kroah-Hartman
Browse files

firmware: Update hotplug script



Update the in-kernel hotplug example script to work
properly with recent kernels. Without this fix the
script may load the firmware twice - both at "add"
and "remove" time.

The second load only triggers in the case when multiple
firmware images are used. A good example is the b43
driver which does not work properly without this fix.

Signed-off-by: default avatarMagnus Damm <damm@opensource.se>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 737a3bb9
Loading
Loading
Loading
Loading
+9 −8
Original line number Diff line number Diff line
@@ -6,11 +6,12 @@

HOTPLUG_FW_DIR=/usr/lib/hotplug/firmware/

if [ "$SUBSYSTEM" == "firmware" -a "$ACTION" == "add" ]; then
  if [ -f $HOTPLUG_FW_DIR/$FIRMWARE ]; then
    echo 1 > /sys/$DEVPATH/loading
    cat $HOTPLUG_FW_DIR/$FIRMWARE > /sys/$DEVPATH/data
    echo 0 > /sys/$DEVPATH/loading

# To cancel the load in case of error:
#
#	echo -1 > /sys/$DEVPATH/loading
#
  else
    echo -1 > /sys/$DEVPATH/loading
  fi
fi