X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=drivers%2Fbase%2Ffirmware_class.c;h=6e17867db85ca8b13f626b02681720e1408d0323;hb=c7b5ebbddf7bcd3651947760f423e3783bbe6573;hp=8ff239f146cfd02c996e2c4427795bfb103909fc;hpb=5273a3df6485dc2ad6aa7ddd441b9a21970f003b;p=linux-2.6.git diff --git a/drivers/base/firmware_class.c b/drivers/base/firmware_class.c index 8ff239f14..6e17867db 100644 --- a/drivers/base/firmware_class.c +++ b/drivers/base/firmware_class.c @@ -12,7 +12,7 @@ #include #include #include -#include +#include #include #include @@ -68,7 +68,7 @@ firmware_timeout_show(struct class *class, char *buf) * firmware will be provided. * * Note: zero means 'wait for ever' - * + * **/ static ssize_t firmware_timeout_store(struct class *class, const char *buf, size_t count) @@ -121,7 +121,7 @@ firmware_loading_show(struct class_device *class_dev, char *buf) /** * firmware_loading_store: - loading control file * Description: - * The relevant values are: + * The relevant values are: * * 1: Start a load, discarding any previous partial load. * 0: Conclude the load and handle the data to the driver code. @@ -235,6 +235,8 @@ firmware_data_write(struct kobject *kobj, struct firmware *fw; ssize_t retval; + if (!capable(CAP_SYS_RAWIO)) + return -EPERM; down(&fw_lock); fw = fw_priv->fw; if (test_bit(FW_STATUS_DONE, &fw_priv->status)) { @@ -376,7 +378,7 @@ out: return retval; } -/** +/** * request_firmware: - request firmware to hotplug and wait for it * Description: * @firmware will be used to return a firmware image by the name @@ -457,7 +459,7 @@ release_firmware(const struct firmware *fw) /** * register_firmware: - provide a firmware image for later usage - * + * * Description: * Make sure that @data will be available by requesting firmware @name. * @@ -541,7 +543,7 @@ request_firmware_nowait( ret = kernel_thread(request_firmware_work_func, fw_work, CLONE_FS | CLONE_FILES); - + if (ret < 0) { fw_work->cont(NULL, fw_work->context); return ret;