mirror of
https://github.com/torvalds/linux.git
synced 2024-12-27 21:33:00 +00:00
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: Magnus Damm <damm@opensource.se> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
parent
737a3bb941
commit
3317fad5e9
@ -6,11 +6,12 @@
|
|||||||
|
|
||||||
HOTPLUG_FW_DIR=/usr/lib/hotplug/firmware/
|
HOTPLUG_FW_DIR=/usr/lib/hotplug/firmware/
|
||||||
|
|
||||||
echo 1 > /sys/$DEVPATH/loading
|
if [ "$SUBSYSTEM" == "firmware" -a "$ACTION" == "add" ]; then
|
||||||
cat $HOTPLUG_FW_DIR/$FIRMWARE > /sys/$DEVPATH/data
|
if [ -f $HOTPLUG_FW_DIR/$FIRMWARE ]; then
|
||||||
echo 0 > /sys/$DEVPATH/loading
|
echo 1 > /sys/$DEVPATH/loading
|
||||||
|
cat $HOTPLUG_FW_DIR/$FIRMWARE > /sys/$DEVPATH/data
|
||||||
# To cancel the load in case of error:
|
echo 0 > /sys/$DEVPATH/loading
|
||||||
#
|
else
|
||||||
# echo -1 > /sys/$DEVPATH/loading
|
echo -1 > /sys/$DEVPATH/loading
|
||||||
#
|
fi
|
||||||
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user