summaryrefslogtreecommitdiffstats
path: root/drivers/base/firmware_class.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2013-01-31 11:13:57 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-02-03 17:57:40 -0800
commit807be03cae191cb88e2f267adcd49aba785c658b (patch)
tree2063de0e040c7985db3a70e26cfc9c19d899ab5b /drivers/base/firmware_class.c
parentcd7239fab7d32e56909027bfb5a6c2d7d3d862f8 (diff)
downloadlinux-807be03cae191cb88e2f267adcd49aba785c658b.tar.bz2
firmware: Ignore abort check when no user-helper is used
FW_STATUS_ABORT can be set only during the user-helper invocation, thus we can ignore the check when CONFIG_HW_LOADER_USER_HELPER is disabled. Acked-by: Ming Lei <ming.lei@canonical.com> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/base/firmware_class.c')
-rw-r--r--drivers/base/firmware_class.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/drivers/base/firmware_class.c b/drivers/base/firmware_class.c
index 51e62ca1d574..4a223fedcd73 100644
--- a/drivers/base/firmware_class.c
+++ b/drivers/base/firmware_class.c
@@ -454,6 +454,9 @@ static void fw_load_abort(struct firmware_priv *fw_priv)
complete_all(&buf->completion);
}
+#define is_fw_load_aborted(buf) \
+ test_bit(FW_STATUS_ABORT, &(buf)->status)
+
static ssize_t firmware_timeout_show(struct class *class,
struct class_attribute *attr,
char *buf)
@@ -891,6 +894,10 @@ fw_load_from_user_helper(struct firmware *firmware, const char *name,
{
return -ENOENT;
}
+
+/* No abort during direct loading */
+#define is_fw_load_aborted(buf) false
+
#endif /* CONFIG_FW_LOADER_USER_HELPER */
@@ -901,7 +908,7 @@ static int sync_cached_firmware_buf(struct firmware_buf *buf)
mutex_lock(&fw_lock);
while (!test_bit(FW_STATUS_DONE, &buf->status)) {
- if (test_bit(FW_STATUS_ABORT, &buf->status)) {
+ if (is_fw_load_aborted(buf)) {
ret = -ENOENT;
break;
}
@@ -963,7 +970,7 @@ static int assign_firmware_buf(struct firmware *fw, struct device *device)
struct firmware_buf *buf = fw->priv;
mutex_lock(&fw_lock);
- if (!buf->size || test_bit(FW_STATUS_ABORT, &buf->status)) {
+ if (!buf->size || is_fw_load_aborted(buf)) {
mutex_unlock(&fw_lock);
return -ENOENT;
}