diff options
Diffstat (limited to 'drivers/base/firmware_class.c')
-rw-r--r-- | drivers/base/firmware_class.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/base/firmware_class.c b/drivers/base/firmware_class.c index 40af43ebd92d..bbb03e6f7255 100644 --- a/drivers/base/firmware_class.c +++ b/drivers/base/firmware_class.c | |||
@@ -521,6 +521,11 @@ static int _request_firmware(const struct firmware **firmware_p, | |||
521 | if (!firmware_p) | 521 | if (!firmware_p) |
522 | return -EINVAL; | 522 | return -EINVAL; |
523 | 523 | ||
524 | if (WARN_ON(usermodehelper_is_disabled())) { | ||
525 | dev_err(device, "firmware: %s will not be loaded\n", name); | ||
526 | return -EBUSY; | ||
527 | } | ||
528 | |||
524 | *firmware_p = firmware = kzalloc(sizeof(*firmware), GFP_KERNEL); | 529 | *firmware_p = firmware = kzalloc(sizeof(*firmware), GFP_KERNEL); |
525 | if (!firmware) { | 530 | if (!firmware) { |
526 | dev_err(device, "%s: kmalloc(struct firmware) failed\n", | 531 | dev_err(device, "%s: kmalloc(struct firmware) failed\n", |
@@ -593,8 +598,7 @@ int | |||
593 | request_firmware(const struct firmware **firmware_p, const char *name, | 598 | request_firmware(const struct firmware **firmware_p, const char *name, |
594 | struct device *device) | 599 | struct device *device) |
595 | { | 600 | { |
596 | int uevent = 1; | 601 | return _request_firmware(firmware_p, name, device, true, false); |
597 | return _request_firmware(firmware_p, name, device, uevent, false); | ||
598 | } | 602 | } |
599 | 603 | ||
600 | /** | 604 | /** |
@@ -618,7 +622,7 @@ struct firmware_work { | |||
618 | struct device *device; | 622 | struct device *device; |
619 | void *context; | 623 | void *context; |
620 | void (*cont)(const struct firmware *fw, void *context); | 624 | void (*cont)(const struct firmware *fw, void *context); |
621 | int uevent; | 625 | bool uevent; |
622 | }; | 626 | }; |
623 | 627 | ||
624 | static int request_firmware_work_func(void *arg) | 628 | static int request_firmware_work_func(void *arg) |
@@ -661,7 +665,7 @@ static int request_firmware_work_func(void *arg) | |||
661 | **/ | 665 | **/ |
662 | int | 666 | int |
663 | request_firmware_nowait( | 667 | request_firmware_nowait( |
664 | struct module *module, int uevent, | 668 | struct module *module, bool uevent, |
665 | const char *name, struct device *device, gfp_t gfp, void *context, | 669 | const char *name, struct device *device, gfp_t gfp, void *context, |
666 | void (*cont)(const struct firmware *fw, void *context)) | 670 | void (*cont)(const struct firmware *fw, void *context)) |
667 | { | 671 | { |