diff options
author | Luis R. Rodriguez <mcgrof@kernel.org> | 2017-11-20 10:23:54 -0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-11-29 11:18:43 +0100 |
commit | 33a5b18de2f5cac6de9b86e137cce2bbf02560d5 (patch) | |
tree | 8819006423418d506e815189eb3538799b0b8f9b /drivers/base/firmware_class.c | |
parent | f1b9cf39af2e56da6e432d1fec3acb6c974c2f8e (diff) | |
download | op-kernel-dev-33a5b18de2f5cac6de9b86e137cce2bbf02560d5.zip op-kernel-dev-33a5b18de2f5cac6de9b86e137cce2bbf02560d5.tar.gz |
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: Luis R. Rodriguez <mcgrof@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/base/firmware_class.c')
-rw-r--r-- | drivers/base/firmware_class.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/drivers/base/firmware_class.c b/drivers/base/firmware_class.c index 3b506d3..dcc1281 100644 --- a/drivers/base/firmware_class.c +++ b/drivers/base/firmware_class.c @@ -263,17 +263,17 @@ static inline bool fw_state_is_aborted(struct fw_priv *fw_priv) #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); } -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); } -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); } @@ -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' * between loading done and disappearance of 'loading' */ - if (fw_state_is_done(fw_priv)) + if (fw_sysfs_done(fw_priv)) return; list_del_init(&fw_priv->pending_list); @@ -728,7 +728,7 @@ static ssize_t firmware_loading_show(struct device *dev, mutex_lock(&fw_lock); 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); return sprintf(buf, "%d\n", loading); @@ -784,7 +784,7 @@ static ssize_t firmware_loading_store(struct device *dev, switch (loading) { case 1: /* 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++) __free_page(fw_priv->pages[i]); vfree(fw_priv->pages); @@ -795,7 +795,7 @@ static ssize_t firmware_loading_store(struct device *dev, } break; case 0: - if (fw_state_is_loading(fw_priv)) { + if (fw_sysfs_loading(fw_priv)) { int rc; /* @@ -884,7 +884,7 @@ static ssize_t firmware_data_read(struct file *filp, struct kobject *kobj, mutex_lock(&fw_lock); 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; goto out; } @@ -971,7 +971,7 @@ static ssize_t firmware_data_write(struct file *filp, struct kobject *kobj, mutex_lock(&fw_lock); 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; goto out; } @@ -1084,7 +1084,7 @@ static int _request_firmware_load(struct fw_sysfs *fw_sysfs, timeout = MAX_JIFFY_OFFSET; } - retval = fw_state_wait_timeout(fw_priv, timeout); + retval = fw_sysfs_wait_timeout(fw_priv, timeout); if (retval < 0) { mutex_lock(&fw_lock); fw_load_abort(fw_sysfs); |