Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

firmware_loader: Move definitions from sysfs_upload.h to sysfs.h

Move definitions required by sysfs.c from sysfs_upload.h to sysfs.h so
that sysfs.c does not need to include sysfs_upload.h.

Signed-off-by: Russ Weight <russell.h.weight@intel.com>
Link: https://lore.kernel.org/r/20220426200356.126085-3-russell.h.weight@intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Russ Weight and committed by
Greg Kroah-Hartman
f8ae07f4 bc187f6f

+20 -20
-1
drivers/base/firmware_loader/sysfs.c
··· 7 7 #include <linux/types.h> 8 8 9 9 #include "sysfs.h" 10 - #include "sysfs_upload.h" 11 10 12 11 /* 13 12 * sysfs support for firmware loader
+15
drivers/base/firmware_loader/sysfs.h
··· 99 99 fw_create_instance(struct firmware *firmware, const char *fw_name, 100 100 struct device *device, u32 opt_flags); 101 101 102 + #ifdef CONFIG_FW_UPLOAD 103 + extern struct device_attribute dev_attr_status; 104 + extern struct device_attribute dev_attr_error; 105 + extern struct device_attribute dev_attr_cancel; 106 + extern struct device_attribute dev_attr_remaining_size; 107 + 108 + int fw_upload_start(struct fw_sysfs *fw_sysfs); 109 + umode_t fw_upload_is_visible(struct kobject *kobj, struct attribute *attr, int n); 110 + #else 111 + static inline int fw_upload_start(struct fw_sysfs *fw_sysfs) 112 + { 113 + return 0; 114 + } 115 + #endif 116 + 102 117 #endif /* __FIRMWARE_SYSFS_H */
-1
drivers/base/firmware_loader/sysfs_upload.c
··· 4 4 #include <linux/module.h> 5 5 #include <linux/slab.h> 6 6 7 - #include "sysfs.h" 8 7 #include "sysfs_upload.h" 9 8 10 9 /*
+5 -18
drivers/base/firmware_loader/sysfs_upload.h
··· 1 1 /* SPDX-License-Identifier: GPL-2.0 */ 2 - #ifndef __FIRMWARE_UPLOAD_H 3 - #define __FIRMWARE_UPLOAD_H 2 + #ifndef __SYSFS_UPLOAD_H 3 + #define __SYSFS_UPLOAD_H 4 4 5 5 #include <linux/device.h> 6 + 7 + #include "sysfs.h" 6 8 7 9 /** 8 10 * enum fw_upload_prog - firmware upload progress codes ··· 38 36 enum fw_upload_err err_code; /* security manager error code */ 39 37 }; 40 38 41 - #ifdef CONFIG_FW_UPLOAD 42 - extern struct device_attribute dev_attr_status; 43 - extern struct device_attribute dev_attr_error; 44 - extern struct device_attribute dev_attr_cancel; 45 - extern struct device_attribute dev_attr_remaining_size; 46 - 47 - int fw_upload_start(struct fw_sysfs *fw_sysfs); 48 - umode_t fw_upload_is_visible(struct kobject *kobj, struct attribute *attr, int n); 49 - #else 50 - static inline int fw_upload_start(struct fw_sysfs *fw_sysfs) 51 - { 52 - return 0; 53 - } 54 - #endif 55 - 56 - #endif /* __FIRMWARE_UPLOAD_H */ 39 + #endif /* __SYSFS_UPLOAD_H */