Commit 33a5b18d authored by Luis R. Rodriguez's avatar Luis R. Rodriguez Committed by Greg Kroah-Hartman

firmware: rename sysfs state checks with sysfs prefix

Doing this makes it clearer the states are only to be used
in the context of the sysfs fallback loading interface.
Signed-off-by: default avatarLuis R. Rodriguez <mcgrof@kernel.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent f1b9cf39
...@@ -263,17 +263,17 @@ static inline bool fw_state_is_aborted(struct fw_priv *fw_priv) ...@@ -263,17 +263,17 @@ static inline bool fw_state_is_aborted(struct fw_priv *fw_priv)
#ifdef CONFIG_FW_LOADER_USER_HELPER #ifdef CONFIG_FW_LOADER_USER_HELPER
static inline bool fw_state_is_done(struct fw_priv *fw_priv) static inline bool fw_sysfs_done(struct fw_priv *fw_priv)
{ {
return __fw_state_check(fw_priv, FW_STATUS_DONE); return __fw_state_check(fw_priv, FW_STATUS_DONE);
} }
static inline bool fw_state_is_loading(struct fw_priv *fw_priv) static inline bool fw_sysfs_loading(struct fw_priv *fw_priv)
{ {
return __fw_state_check(fw_priv, FW_STATUS_LOADING); return __fw_state_check(fw_priv, FW_STATUS_LOADING);
} }
static inline int fw_state_wait_timeout(struct fw_priv *fw_priv, long timeout) static inline int fw_sysfs_wait_timeout(struct fw_priv *fw_priv, long timeout)
{ {
return __fw_state_wait_common(fw_priv, timeout); return __fw_state_wait_common(fw_priv, timeout);
} }
...@@ -606,7 +606,7 @@ static void __fw_load_abort(struct fw_priv *fw_priv) ...@@ -606,7 +606,7 @@ static void __fw_load_abort(struct fw_priv *fw_priv)
* There is a small window in which user can write to 'loading' * There is a small window in which user can write to 'loading'
* between loading done and disappearance of 'loading' * between loading done and disappearance of 'loading'
*/ */
if (fw_state_is_done(fw_priv)) if (fw_sysfs_done(fw_priv))
return; return;
list_del_init(&fw_priv->pending_list); list_del_init(&fw_priv->pending_list);
...@@ -728,7 +728,7 @@ static ssize_t firmware_loading_show(struct device *dev, ...@@ -728,7 +728,7 @@ static ssize_t firmware_loading_show(struct device *dev,
mutex_lock(&fw_lock); mutex_lock(&fw_lock);
if (fw_sysfs->fw_priv) if (fw_sysfs->fw_priv)
loading = fw_state_is_loading(fw_sysfs->fw_priv); loading = fw_sysfs_loading(fw_sysfs->fw_priv);
mutex_unlock(&fw_lock); mutex_unlock(&fw_lock);
return sprintf(buf, "%d\n", loading); return sprintf(buf, "%d\n", loading);
...@@ -784,7 +784,7 @@ static ssize_t firmware_loading_store(struct device *dev, ...@@ -784,7 +784,7 @@ static ssize_t firmware_loading_store(struct device *dev,
switch (loading) { switch (loading) {
case 1: case 1:
/* discarding any previous partial load */ /* discarding any previous partial load */
if (!fw_state_is_done(fw_priv)) { if (!fw_sysfs_done(fw_priv)) {
for (i = 0; i < fw_priv->nr_pages; i++) for (i = 0; i < fw_priv->nr_pages; i++)
__free_page(fw_priv->pages[i]); __free_page(fw_priv->pages[i]);
vfree(fw_priv->pages); vfree(fw_priv->pages);
...@@ -795,7 +795,7 @@ static ssize_t firmware_loading_store(struct device *dev, ...@@ -795,7 +795,7 @@ static ssize_t firmware_loading_store(struct device *dev,
} }
break; break;
case 0: case 0:
if (fw_state_is_loading(fw_priv)) { if (fw_sysfs_loading(fw_priv)) {
int rc; int rc;
/* /*
...@@ -884,7 +884,7 @@ static ssize_t firmware_data_read(struct file *filp, struct kobject *kobj, ...@@ -884,7 +884,7 @@ static ssize_t firmware_data_read(struct file *filp, struct kobject *kobj,
mutex_lock(&fw_lock); mutex_lock(&fw_lock);
fw_priv = fw_sysfs->fw_priv; fw_priv = fw_sysfs->fw_priv;
if (!fw_priv || fw_state_is_done(fw_priv)) { if (!fw_priv || fw_sysfs_done(fw_priv)) {
ret_count = -ENODEV; ret_count = -ENODEV;
goto out; goto out;
} }
...@@ -971,7 +971,7 @@ static ssize_t firmware_data_write(struct file *filp, struct kobject *kobj, ...@@ -971,7 +971,7 @@ static ssize_t firmware_data_write(struct file *filp, struct kobject *kobj,
mutex_lock(&fw_lock); mutex_lock(&fw_lock);
fw_priv = fw_sysfs->fw_priv; fw_priv = fw_sysfs->fw_priv;
if (!fw_priv || fw_state_is_done(fw_priv)) { if (!fw_priv || fw_sysfs_done(fw_priv)) {
retval = -ENODEV; retval = -ENODEV;
goto out; goto out;
} }
...@@ -1084,7 +1084,7 @@ static int _request_firmware_load(struct fw_sysfs *fw_sysfs, ...@@ -1084,7 +1084,7 @@ static int _request_firmware_load(struct fw_sysfs *fw_sysfs,
timeout = MAX_JIFFY_OFFSET; timeout = MAX_JIFFY_OFFSET;
} }
retval = fw_state_wait_timeout(fw_priv, timeout); retval = fw_sysfs_wait_timeout(fw_priv, timeout);
if (retval < 0) { if (retval < 0) {
mutex_lock(&fw_lock); mutex_lock(&fw_lock);
fw_load_abort(fw_sysfs); fw_load_abort(fw_sysfs);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment