mirror of https://gitee.com/openkylin/linux.git
firmware_loader: change enum fw_opt to u32
"enum fw_opt" is not used as an enum. Change fw_opt to u32 as FW_OPT_* values are OR'd together. Signed-off-by: Scott Branden <scott.branden@broadcom.com> Acked-by: Luis Chamberlain <mcgrof@kernel.org> Link: https://lore.kernel.org/r/20200522231202.13681-1-scott.branden@broadcom.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
46d26819a5
commit
c2c076166b
|
@ -463,7 +463,7 @@ static const struct attribute_group *fw_dev_attr_groups[] = {
|
||||||
|
|
||||||
static struct fw_sysfs *
|
static struct fw_sysfs *
|
||||||
fw_create_instance(struct firmware *firmware, const char *fw_name,
|
fw_create_instance(struct firmware *firmware, const char *fw_name,
|
||||||
struct device *device, enum fw_opt opt_flags)
|
struct device *device, u32 opt_flags)
|
||||||
{
|
{
|
||||||
struct fw_sysfs *fw_sysfs;
|
struct fw_sysfs *fw_sysfs;
|
||||||
struct device *f_dev;
|
struct device *f_dev;
|
||||||
|
@ -496,7 +496,7 @@ fw_create_instance(struct firmware *firmware, const char *fw_name,
|
||||||
* In charge of constructing a sysfs fallback interface for firmware loading.
|
* In charge of constructing a sysfs fallback interface for firmware loading.
|
||||||
**/
|
**/
|
||||||
static int fw_load_sysfs_fallback(struct fw_sysfs *fw_sysfs,
|
static int fw_load_sysfs_fallback(struct fw_sysfs *fw_sysfs,
|
||||||
enum fw_opt opt_flags, long timeout)
|
u32 opt_flags, long timeout)
|
||||||
{
|
{
|
||||||
int retval = 0;
|
int retval = 0;
|
||||||
struct device *f_dev = &fw_sysfs->dev;
|
struct device *f_dev = &fw_sysfs->dev;
|
||||||
|
@ -550,7 +550,7 @@ static int fw_load_sysfs_fallback(struct fw_sysfs *fw_sysfs,
|
||||||
|
|
||||||
static int fw_load_from_user_helper(struct firmware *firmware,
|
static int fw_load_from_user_helper(struct firmware *firmware,
|
||||||
const char *name, struct device *device,
|
const char *name, struct device *device,
|
||||||
enum fw_opt opt_flags)
|
u32 opt_flags)
|
||||||
{
|
{
|
||||||
struct fw_sysfs *fw_sysfs;
|
struct fw_sysfs *fw_sysfs;
|
||||||
long timeout;
|
long timeout;
|
||||||
|
@ -591,7 +591,7 @@ static int fw_load_from_user_helper(struct firmware *firmware,
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool fw_force_sysfs_fallback(enum fw_opt opt_flags)
|
static bool fw_force_sysfs_fallback(u32 opt_flags)
|
||||||
{
|
{
|
||||||
if (fw_fallback_config.force_sysfs_fallback)
|
if (fw_fallback_config.force_sysfs_fallback)
|
||||||
return true;
|
return true;
|
||||||
|
@ -600,7 +600,7 @@ static bool fw_force_sysfs_fallback(enum fw_opt opt_flags)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool fw_run_sysfs_fallback(enum fw_opt opt_flags)
|
static bool fw_run_sysfs_fallback(u32 opt_flags)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
|
@ -643,7 +643,7 @@ static bool fw_run_sysfs_fallback(enum fw_opt opt_flags)
|
||||||
**/
|
**/
|
||||||
int firmware_fallback_sysfs(struct firmware *fw, const char *name,
|
int firmware_fallback_sysfs(struct firmware *fw, const char *name,
|
||||||
struct device *device,
|
struct device *device,
|
||||||
enum fw_opt opt_flags,
|
u32 opt_flags,
|
||||||
int ret)
|
int ret)
|
||||||
{
|
{
|
||||||
if (!fw_run_sysfs_fallback(opt_flags))
|
if (!fw_run_sysfs_fallback(opt_flags))
|
||||||
|
|
|
@ -33,7 +33,7 @@ struct firmware_fallback_config {
|
||||||
#ifdef CONFIG_FW_LOADER_USER_HELPER
|
#ifdef CONFIG_FW_LOADER_USER_HELPER
|
||||||
int firmware_fallback_sysfs(struct firmware *fw, const char *name,
|
int firmware_fallback_sysfs(struct firmware *fw, const char *name,
|
||||||
struct device *device,
|
struct device *device,
|
||||||
enum fw_opt opt_flags,
|
u32 opt_flags,
|
||||||
int ret);
|
int ret);
|
||||||
void kill_pending_fw_fallback_reqs(bool only_kill_custom);
|
void kill_pending_fw_fallback_reqs(bool only_kill_custom);
|
||||||
|
|
||||||
|
@ -45,7 +45,7 @@ void unregister_sysfs_loader(void);
|
||||||
#else /* CONFIG_FW_LOADER_USER_HELPER */
|
#else /* CONFIG_FW_LOADER_USER_HELPER */
|
||||||
static inline int firmware_fallback_sysfs(struct firmware *fw, const char *name,
|
static inline int firmware_fallback_sysfs(struct firmware *fw, const char *name,
|
||||||
struct device *device,
|
struct device *device,
|
||||||
enum fw_opt opt_flags,
|
u32 opt_flags,
|
||||||
int ret)
|
int ret)
|
||||||
{
|
{
|
||||||
/* Keep carrying over the same error */
|
/* Keep carrying over the same error */
|
||||||
|
@ -67,10 +67,10 @@ static inline void unregister_sysfs_loader(void)
|
||||||
#endif /* CONFIG_FW_LOADER_USER_HELPER */
|
#endif /* CONFIG_FW_LOADER_USER_HELPER */
|
||||||
|
|
||||||
#ifdef CONFIG_EFI_EMBEDDED_FIRMWARE
|
#ifdef CONFIG_EFI_EMBEDDED_FIRMWARE
|
||||||
int firmware_fallback_platform(struct fw_priv *fw_priv, enum fw_opt opt_flags);
|
int firmware_fallback_platform(struct fw_priv *fw_priv, u32 opt_flags);
|
||||||
#else
|
#else
|
||||||
static inline int firmware_fallback_platform(struct fw_priv *fw_priv,
|
static inline int firmware_fallback_platform(struct fw_priv *fw_priv,
|
||||||
enum fw_opt opt_flags)
|
u32 opt_flags)
|
||||||
{
|
{
|
||||||
return -ENOENT;
|
return -ENOENT;
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
#include "fallback.h"
|
#include "fallback.h"
|
||||||
#include "firmware.h"
|
#include "firmware.h"
|
||||||
|
|
||||||
int firmware_fallback_platform(struct fw_priv *fw_priv, enum fw_opt opt_flags)
|
int firmware_fallback_platform(struct fw_priv *fw_priv, u32 opt_flags)
|
||||||
{
|
{
|
||||||
const u8 *data;
|
const u8 *data;
|
||||||
size_t size;
|
size_t size;
|
||||||
|
|
|
@ -136,8 +136,7 @@ static inline void fw_state_done(struct fw_priv *fw_priv)
|
||||||
__fw_state_set(fw_priv, FW_STATUS_DONE);
|
__fw_state_set(fw_priv, FW_STATUS_DONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
int assign_fw(struct firmware *fw, struct device *device,
|
int assign_fw(struct firmware *fw, struct device *device, u32 opt_flags);
|
||||||
enum fw_opt opt_flags);
|
|
||||||
|
|
||||||
#ifdef CONFIG_FW_LOADER_PAGED_BUF
|
#ifdef CONFIG_FW_LOADER_PAGED_BUF
|
||||||
void fw_free_paged_buf(struct fw_priv *fw_priv);
|
void fw_free_paged_buf(struct fw_priv *fw_priv);
|
||||||
|
|
|
@ -210,7 +210,7 @@ static struct fw_priv *__lookup_fw_priv(const char *fw_name)
|
||||||
static int alloc_lookup_fw_priv(const char *fw_name,
|
static int alloc_lookup_fw_priv(const char *fw_name,
|
||||||
struct firmware_cache *fwc,
|
struct firmware_cache *fwc,
|
||||||
struct fw_priv **fw_priv, void *dbuf,
|
struct fw_priv **fw_priv, void *dbuf,
|
||||||
size_t size, enum fw_opt opt_flags)
|
size_t size, u32 opt_flags)
|
||||||
{
|
{
|
||||||
struct fw_priv *tmp;
|
struct fw_priv *tmp;
|
||||||
|
|
||||||
|
@ -632,8 +632,7 @@ static int fw_add_devm_name(struct device *dev, const char *name)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
int assign_fw(struct firmware *fw, struct device *device,
|
int assign_fw(struct firmware *fw, struct device *device, u32 opt_flags)
|
||||||
enum fw_opt opt_flags)
|
|
||||||
{
|
{
|
||||||
struct fw_priv *fw_priv = fw->priv;
|
struct fw_priv *fw_priv = fw->priv;
|
||||||
int ret;
|
int ret;
|
||||||
|
@ -684,7 +683,7 @@ int assign_fw(struct firmware *fw, struct device *device,
|
||||||
static int
|
static int
|
||||||
_request_firmware_prepare(struct firmware **firmware_p, const char *name,
|
_request_firmware_prepare(struct firmware **firmware_p, const char *name,
|
||||||
struct device *device, void *dbuf, size_t size,
|
struct device *device, void *dbuf, size_t size,
|
||||||
enum fw_opt opt_flags)
|
u32 opt_flags)
|
||||||
{
|
{
|
||||||
struct firmware *firmware;
|
struct firmware *firmware;
|
||||||
struct fw_priv *fw_priv;
|
struct fw_priv *fw_priv;
|
||||||
|
@ -750,7 +749,7 @@ static void fw_abort_batch_reqs(struct firmware *fw)
|
||||||
static int
|
static int
|
||||||
_request_firmware(const struct firmware **firmware_p, const char *name,
|
_request_firmware(const struct firmware **firmware_p, const char *name,
|
||||||
struct device *device, void *buf, size_t size,
|
struct device *device, void *buf, size_t size,
|
||||||
enum fw_opt opt_flags)
|
u32 opt_flags)
|
||||||
{
|
{
|
||||||
struct firmware *fw = NULL;
|
struct firmware *fw = NULL;
|
||||||
int ret;
|
int ret;
|
||||||
|
@ -987,7 +986,7 @@ struct firmware_work {
|
||||||
struct device *device;
|
struct device *device;
|
||||||
void *context;
|
void *context;
|
||||||
void (*cont)(const struct firmware *fw, void *context);
|
void (*cont)(const struct firmware *fw, void *context);
|
||||||
enum fw_opt opt_flags;
|
u32 opt_flags;
|
||||||
};
|
};
|
||||||
|
|
||||||
static void request_firmware_work_func(struct work_struct *work)
|
static void request_firmware_work_func(struct work_struct *work)
|
||||||
|
|
Loading…
Reference in New Issue