]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
firmware loader: fix creation failure of fw loader device
authorMing Lei <ming.lei@canonical.com>
Sat, 4 Aug 2012 04:01:19 +0000 (12:01 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 16 Aug 2012 20:13:19 +0000 (13:13 -0700)
If one device driver calls request_firmware_nowait() to request
several different firmwares' loading, device_add() will return
failure since all firmware loader device use same name of the
device who is requesting firmware.

This patch always use the name of firmware image as the firmware
loader device name to fix the problem since the following patches
for caching firmware will make sure only one loading for same
firmware is alllowd at the same time.

Signed-off-by: Ming Lei <ming.lei@canonical.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/base/firmware_class.c

index 0bd09c7545c960efad22a610bd550adcc8282877..04c75b56f4fcec6e03495818bfb4af789c1264a8 100644 (file)
@@ -452,7 +452,7 @@ fw_create_instance(struct firmware *firmware, const char *fw_name,
        f_dev = &fw_priv->dev;
 
        device_initialize(f_dev);
-       dev_set_name(f_dev, "%s", dev_name(device));
+       dev_set_name(f_dev, "%s", fw_name);
        f_dev->parent = device;
        f_dev->class = &firmware_class;