From: Russ Weight <russell.h.weight@intel.com>
To: mcgrof@kernel.org, gregkh@linuxfoundation.org, rafael@kernel.org,
linux-kernel@vger.kernel.org
Cc: trix@redhat.com, marpagan@redhat.com, lgoncalv@redhat.com,
yilun.xu@intel.com, hao.wu@intel.com,
matthew.gerlach@linux.intel.com,
basheer.ahmed.muddebihal@intel.com, tianfei.zhang@intel.com,
Russ Weight <russell.h.weight@intel.com>
Subject: [PATCH v1 1/2] firmware_loader: Fix configs for sysfs split
Date: Tue, 26 Apr 2022 13:03:55 -0700 [thread overview]
Message-ID: <20220426200356.126085-2-russell.h.weight@intel.com> (raw)
In-Reply-To: <20220426200356.126085-1-russell.h.weight@intel.com>
Fix the CONFIGs around register_sysfs_loader(),
unregister_sysfs_loader(), register_firmware_config_sysctl(), and
unregister_firmware_config_sysctl(). The full definitions of the
register_sysfs_loader() and unregister_sysfs_loader() functions should
be used whenever CONFIG_FW_LOADER_SYSFS is defined. The
register_firmware_config_sysctl() and unregister_firmware_config_sysctl()
functions should be stubbed out unless CONFIG_FW_LOADER_USER_HELPER
CONFIG_SYSCTL are both defined.
Signed-off-by: Russ Weight <russell.h.weight@intel.com>
---
drivers/base/firmware_loader/sysfs.c | 2 --
drivers/base/firmware_loader/sysfs.h | 10 ++++++----
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/base/firmware_loader/sysfs.c b/drivers/base/firmware_loader/sysfs.c
index c09fcebeada9..eb7d9322a56e 100644
--- a/drivers/base/firmware_loader/sysfs.c
+++ b/drivers/base/firmware_loader/sysfs.c
@@ -110,7 +110,6 @@ static struct class firmware_class = {
.dev_release = fw_dev_release,
};
-#ifdef CONFIG_FW_LOADER_USER_HELPER
int register_sysfs_loader(void)
{
int ret = class_register(&firmware_class);
@@ -125,7 +124,6 @@ void unregister_sysfs_loader(void)
unregister_firmware_config_sysctl();
class_unregister(&firmware_class);
}
-#endif
static ssize_t firmware_loading_show(struct device *dev,
struct device_attribute *attr, char *buf)
diff --git a/drivers/base/firmware_loader/sysfs.h b/drivers/base/firmware_loader/sysfs.h
index c21bcfe374ff..e6c487937817 100644
--- a/drivers/base/firmware_loader/sysfs.h
+++ b/drivers/base/firmware_loader/sysfs.h
@@ -46,10 +46,12 @@ static inline void __fw_fallback_set_timeout(int timeout)
{
fw_fallback_config.loading_timeout = timeout;
}
+#endif
+#ifdef CONFIG_FW_LOADER_SYSFS
int register_sysfs_loader(void);
void unregister_sysfs_loader(void);
-#ifdef CONFIG_SYSCTL
+#if defined(CONFIG_FW_LOADER_USER_HELPER) && defined(CONFIG_SYSCTL)
int register_firmware_config_sysctl(void);
void unregister_firmware_config_sysctl(void);
#else
@@ -59,8 +61,8 @@ static inline int register_firmware_config_sysctl(void)
}
static inline void unregister_firmware_config_sysctl(void) { }
-#endif /* CONFIG_SYSCTL */
-#else /* CONFIG_FW_LOADER_USER_HELPER */
+#endif /* CONFIG_FW_LOADER_USER_HELPER && CONFIG_SYSCTL */
+#else /* CONFIG_FW_LOADER_SYSFS */
static inline int register_sysfs_loader(void)
{
return 0;
@@ -69,7 +71,7 @@ static inline int register_sysfs_loader(void)
static inline void unregister_sysfs_loader(void)
{
}
-#endif /* CONFIG_FW_LOADER_USER_HELPER */
+#endif /* CONFIG_FW_LOADER_SYSFS */
struct fw_sysfs {
bool nowait;
--
2.25.1
next prev parent reply other threads:[~2022-04-26 20:04 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-26 20:03 [PATCH v1 0/2] Fix-up patches for Firmware Uploads Russ Weight
2022-04-26 20:03 ` Russ Weight [this message]
2022-04-26 20:03 ` [PATCH v1 2/2] firmware_loader: Move definitions from sysfs_upload.h to sysfs.h Russ Weight
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220426200356.126085-2-russell.h.weight@intel.com \
--to=russell.h.weight@intel.com \
--cc=basheer.ahmed.muddebihal@intel.com \
--cc=gregkh@linuxfoundation.org \
--cc=hao.wu@intel.com \
--cc=lgoncalv@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=marpagan@redhat.com \
--cc=matthew.gerlach@linux.intel.com \
--cc=mcgrof@kernel.org \
--cc=rafael@kernel.org \
--cc=tianfei.zhang@intel.com \
--cc=trix@redhat.com \
--cc=yilun.xu@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®