提交 3317fad5 编写于 作者: M Magnus Damm 提交者: Greg Kroah-Hartman

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: NMagnus Damm <damm@opensource.se>
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
上级 737a3bb9
......@@ -6,11 +6,12 @@
HOTPLUG_FW_DIR=/usr/lib/hotplug/firmware/
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
#
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
else
echo -1 > /sys/$DEVPATH/loading
fi
fi
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册