From: Greg Kroah-Hartman <gregkh@suse.de>
To: linux-kernel@vger.kernel.org
Cc: Magnus Damm <damm@opensource.se>, Greg Kroah-Hartman <gregkh@suse.de>
Subject: [PATCH 12/28] firmware: Update hotplug script
Date: Thu, 5 Aug 2010 15:24:02 -0700 [thread overview]
Message-ID: <1281047058-23716-12-git-send-email-gregkh@suse.de> (raw)
In-Reply-To: <20100805213314.GB13744@kroah.com>
From: Magnus Damm <damm@opensource.se>
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>
---
Documentation/firmware_class/hotplug-script | 17 +++++++++--------
1 files changed, 9 insertions(+), 8 deletions(-)
diff --git a/Documentation/firmware_class/hotplug-script b/Documentation/firmware_class/hotplug-script
index 1990130..8143a95 100644
--- a/Documentation/firmware_class/hotplug-script
+++ b/Documentation/firmware_class/hotplug-script
@@ -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
--
1.7.2
next prev parent reply other threads:[~2010-08-05 22:34 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-08-05 21:33 [GIT PATCH] driver core patches for .36 Greg KH
2010-08-05 22:23 ` [PATCH 01/28] uio: Remove IRQF_DISABLED flag from uio_pdrv_genirq.c Greg Kroah-Hartman
2010-08-05 22:23 ` [PATCH 02/28] uio: Remove IRQF_DISABLED from uio_sercos3.c Greg Kroah-Hartman
2010-08-05 22:23 ` [PATCH 03/28] uio: Remove IRQF_DISABLED flag from uio_cif.c Greg Kroah-Hartman
2010-08-05 22:23 ` [PATCH 04/28] hotplug: Support kernel/hotplug sysctl variable when !CONFIG_NET Greg Kroah-Hartman
2010-08-05 22:23 ` [PATCH 05/28] Driver core: internal struct dma_coherent_mem, change type of a member Greg Kroah-Hartman
2010-08-05 22:23 ` [PATCH 06/28] Driver core: Drop __must_check from bus_for_each_drv() Greg Kroah-Hartman
2010-08-05 22:23 ` [PATCH 07/28] firmware loader: use statically initialized data attribute Greg Kroah-Hartman
2010-08-05 22:23 ` [PATCH 08/28] firmware loader: embed device into firmware_priv structure Greg Kroah-Hartman
2010-08-05 22:23 ` [PATCH 09/28] Driver core: use kmemdup in platform_device_add_resources Greg Kroah-Hartman
2010-08-05 22:24 ` [PATCH 10/28] Driver core: reduce duplicated code for platform_device creation Greg Kroah-Hartman
2010-08-05 22:24 ` [PATCH 11/28] Driver core: move platform device creation helpers to .init.text (if MODULE=n) Greg Kroah-Hartman
2010-08-05 22:24 ` Greg Kroah-Hartman [this message]
2010-08-05 22:24 ` [PATCH 13/28] sysfs: sysfs_chmod_file's attr can be const Greg Kroah-Hartman
2010-08-05 22:24 ` [PATCH 14/28] dmi-id: fix a memory leak in dmi_id_init error path Greg Kroah-Hartman
2010-08-05 22:24 ` [PATCH 15/28] dcdbas: remove a redundant smi_data_buf_free in dcdbas_exit Greg Kroah-Hartman
2010-08-05 22:24 ` [PATCH 16/28] sysfs: fix discrepancies between implementation and documentation Greg Kroah-Hartman
2010-08-05 22:24 ` [PATCH 17/28] sysfs: Fix one more signature discrepancy between sysfs implementation and docs Greg Kroah-Hartman
2010-08-05 22:24 ` [PATCH 18/28] debugfs: no longer needs to depend on SYSFS Greg Kroah-Hartman
2010-08-05 22:24 ` [PATCH 19/28] driver core: fix memory leak on one error path in bus_register() Greg Kroah-Hartman
2010-08-05 22:24 ` [PATCH 20/28] Driver core: Add BUS_NOTIFY_BIND_DRIVER Greg Kroah-Hartman
2010-08-05 22:24 ` [PATCH 21/28] cgroupfs: create /sys/fs/cgroup to mount cgroupfs on Greg Kroah-Hartman
2010-08-05 22:24 ` [PATCH 22/28] scsi: Remove owner field from attribute initialization in LPFC driver Greg Kroah-Hartman
2010-08-05 22:24 ` [PATCH 23/28] scsi: Remove owner field from attribute initialization in ARCMSR driver Greg Kroah-Hartman
2010-08-05 22:24 ` [PATCH 24/28] leds: Remove owner field from attribute initialization in bd2802 driver Greg Kroah-Hartman
2010-08-05 22:24 ` [PATCH 25/28] regulator: Remove owner field from attribute initialization in regulator core driver Greg Kroah-Hartman
2010-08-05 22:24 ` [PATCH 26/28] powerpc/pci: Remove owner field from attribute initialization in PCI bridge init Greg Kroah-Hartman
2010-08-05 22:24 ` [PATCH 27/28] sysfs: Remove owner field from sysfs struct attribute Greg Kroah-Hartman
2010-08-05 22:24 ` [PATCH 28/28] driver core: device_rename's new_name can be const Greg Kroah-Hartman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1281047058-23716-12-git-send-email-gregkh@suse.de \
--to=gregkh@suse.de \
--cc=damm@opensource.se \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox