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.
Unified · Split
| @@ -7,7 +7,6 @@ · 6 unmodified lines | |||
| 7 | #include <linux/types.h> | 7 | #include <linux/types.h> |
| 8 | 8 | ||
| 9 | #include "sysfs.h" | 9 | #include "sysfs.h" |
| 10 | #include "sysfs_upload.h" | ||
| 11 | 10 | ||
| 12 | /* | 11 | /* |
| 13 | * sysfs support for firmware loader | 12 | * sysfs support for firmware loader |
| @@ -99,4 +99,19 @@ struct fw_sysfs * · 98 unmodified lines | |||
| 99 | fw_create_instance(struct firmware *firmware, const char *fw_name, | 99 | fw_create_instance(struct firmware *firmware, const char *fw_name, |
| 100 | struct device *device, u32 opt_flags); | 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 | #endif /* __FIRMWARE_SYSFS_H */ | 117 | #endif /* __FIRMWARE_SYSFS_H */ |
| @@ -4,7 +4,6 @@ · 3 unmodified lines | |||
| 4 | #include <linux/module.h> | 4 | #include <linux/module.h> |
| 5 | #include <linux/slab.h> | 5 | #include <linux/slab.h> |
| 6 | 6 | ||
| 7 | #include "sysfs.h" | ||
| 8 | #include "sysfs_upload.h" | 7 | #include "sysfs_upload.h" |
| 9 | 8 | ||
| 10 | /* | 9 | /* |
| @@ -1,9 +1,11 @@ | |||
| 1 | /* SPDX-License-Identifier: GPL-2.0 */ | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
| 2 | #ifndef __FIRMWARE_UPLOAD_H | 2 | #ifndef __SYSFS_UPLOAD_H |
| 3 | #define __FIRMWARE_UPLOAD_H | 3 | #define __SYSFS_UPLOAD_H |
| 4 | 4 | ||
| 5 | #include <linux/device.h> | 5 | #include <linux/device.h> |
| 6 | 6 | ||
| 7 | #include "sysfs.h" | ||
| 8 | |||
| 7 | /** | 9 | /** |
| 8 | * enum fw_upload_prog - firmware upload progress codes | 10 | * enum fw_upload_prog - firmware upload progress codes |
| 9 | * @FW_UPLOAD_PROG_IDLE: there is no firmware upload in progress | 11 | * @FW_UPLOAD_PROG_IDLE: there is no firmware upload in progress |
| @@ -36,19 +38,4 @@ struct fw_upload_priv { · 26 unmodified lines | |||
| 36 | enum fw_upload_err err_code; /* security manager error code */ | 38 | enum fw_upload_err err_code; /* security manager error code */ |
| 37 | }; | 39 | }; |
| 38 | 40 | ||
| 39 | #ifdef CONFIG_FW_UPLOAD | 41 | #endif /* __SYSFS_UPLOAD_H */ |
| 40 | extern struct device_attribute dev_attr_status; | ||
| 41 | extern struct device_attribute dev_attr_error; | ||
| 42 | extern struct device_attribute dev_attr_cancel; | ||
| 43 | extern struct device_attribute dev_attr_remaining_size; | ||
| 44 | |||
| 45 | int fw_upload_start(struct fw_sysfs *fw_sysfs); | ||
| 46 | umode_t fw_upload_is_visible(struct kobject *kobj, struct attribute *attr, int n); | ||
| 47 | #else | ||
| 48 | static inline int fw_upload_start(struct fw_sysfs *fw_sysfs) | ||
| 49 | { | ||
| 50 | return 0; | ||
| 51 | } | ||
| 52 | #endif | ||
| 53 | |||
| 54 | #endif /* __FIRMWARE_UPLOAD_H */ | ||