firmware_loader: Move definitions from sysfs_upload.h to sysfs.h
authorRuss Weight <russell.h.weight@intel.com>
Tue, 26 Apr 2022 20:03:56 +0000 (13:03 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 29 Apr 2022 14:49:44 +0000 (16:49 +0200)
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>
drivers/base/firmware_loader/sysfs.c
drivers/base/firmware_loader/sysfs.h
drivers/base/firmware_loader/sysfs_upload.c
drivers/base/firmware_loader/sysfs_upload.h

index eb7d932..5b0b85b 100644 (file)
@@ -7,7 +7,6 @@
 #include <linux/types.h>
 
 #include "sysfs.h"
-#include "sysfs_upload.h"
 
 /*
  * sysfs support for firmware loader
index e6c4879..5d8ff16 100644 (file)
@@ -99,4 +99,19 @@ struct fw_sysfs *
 fw_create_instance(struct firmware *firmware, const char *fw_name,
                   struct device *device, u32 opt_flags);
 
+#ifdef CONFIG_FW_UPLOAD
+extern struct device_attribute dev_attr_status;
+extern struct device_attribute dev_attr_error;
+extern struct device_attribute dev_attr_cancel;
+extern struct device_attribute dev_attr_remaining_size;
+
+int fw_upload_start(struct fw_sysfs *fw_sysfs);
+umode_t fw_upload_is_visible(struct kobject *kobj, struct attribute *attr, int n);
+#else
+static inline int fw_upload_start(struct fw_sysfs *fw_sysfs)
+{
+       return 0;
+}
+#endif
+
 #endif /* __FIRMWARE_SYSFS_H */
index c504dae..8cdcf35 100644 (file)
@@ -4,7 +4,6 @@
 #include <linux/module.h>
 #include <linux/slab.h>
 
-#include "sysfs.h"
 #include "sysfs_upload.h"
 
 /*
index 9edd47d..31931ff 100644 (file)
@@ -1,9 +1,11 @@
 /* SPDX-License-Identifier: GPL-2.0 */
-#ifndef __FIRMWARE_UPLOAD_H
-#define __FIRMWARE_UPLOAD_H
+#ifndef __SYSFS_UPLOAD_H
+#define __SYSFS_UPLOAD_H
 
 #include <linux/device.h>
 
+#include "sysfs.h"
+
 /**
  * enum fw_upload_prog - firmware upload progress codes
  * @FW_UPLOAD_PROG_IDLE: there is no firmware upload in progress
@@ -36,19 +38,4 @@ struct fw_upload_priv {
        enum fw_upload_err err_code;      /* security manager error code */
 };
 
-#ifdef CONFIG_FW_UPLOAD
-extern struct device_attribute dev_attr_status;
-extern struct device_attribute dev_attr_error;
-extern struct device_attribute dev_attr_cancel;
-extern struct device_attribute dev_attr_remaining_size;
-
-int fw_upload_start(struct fw_sysfs *fw_sysfs);
-umode_t fw_upload_is_visible(struct kobject *kobj, struct attribute *attr, int n);
-#else
-static inline int fw_upload_start(struct fw_sysfs *fw_sysfs)
-{
-       return 0;
-}
-#endif
-
-#endif /* __FIRMWARE_UPLOAD_H */
+#endif /* __SYSFS_UPLOAD_H */