[vRFC,8/8] firmware: FW_OPT_UEVENT for all request_firmware family functions

Message ID 20240222180033.23775-9-quic_mojha@quicinc.com
State New
Headers
Series Refactor and rename request firmware API |

Commit Message

Mukesh Ojha Feb. 22, 2024, 6 p.m. UTC
  Currently, FW_OPT_UEVENT is used in almost every request_firmware
family function apart from request_firmware_nowait(), however,
request_firmware_nowait() uses much lower level api which does
not assume FW_OPT_UEVENT to be a default flag.

Apply FW_OPT_UEVENT as default flag.

Signed-off-by: Mukesh Ojha <quic_mojha@quicinc.com>
---
 drivers/base/firmware_loader/main.c | 19 ++++++++-----------
 1 file changed, 8 insertions(+), 11 deletions(-)
  

Patch

diff --git a/drivers/base/firmware_loader/main.c b/drivers/base/firmware_loader/main.c
index 91a45767a3a7..4650fef9b713 100644
--- a/drivers/base/firmware_loader/main.c
+++ b/drivers/base/firmware_loader/main.c
@@ -985,7 +985,8 @@  _request_firmware(const struct firmware **firmware_p, const char *name,
 
 	/* Need to pin this module until return */
 	__module_get(THIS_MODULE);
-	ret = __request_firmware(firmware_p, name, device, NULL, 0, 0, opt_flags);
+	ret = __request_firmware(firmware_p, name, device, NULL, 0, 0,
+				 FW_OPT_UEVENT | opt_flags);
 	module_put(THIS_MODULE);
 	return ret;
 }
@@ -1013,8 +1014,7 @@  int
 request_firmware(const struct firmware **firmware_p, const char *name,
 		 struct device *device)
 {
-	return _request_firmware(firmware_p, name, device, NULL, 0, 0,
-				 FW_OPT_UEVENT);
+	return _request_firmware(firmware_p, name, device, NULL, 0, 0, 0);
 }
 EXPORT_SYMBOL(request_firmware);
 
@@ -1034,8 +1034,7 @@  EXPORT_SYMBOL(request_firmware);
 int request_firmware_nowarn(const struct firmware **firmware, const char *name,
 			    struct device *device)
 {
-	return _request_firmware(firmware, name, device, NULL, 0, 0,
-				 FW_OPT_UEVENT | FW_OPT_NO_WARN);
+	return _request_firmware(firmware, name, device, NULL, 0, 0, FW_OPT_NO_WARN);
 }
 EXPORT_SYMBOL_GPL(request_firmware_nowarn);
 
@@ -1054,8 +1053,7 @@  int request_firmware_direct(const struct firmware **firmware_p,
 			    const char *name, struct device *device)
 {
 	return _request_firmware(firmware_p, name, device, NULL, 0, 0,
-				 FW_OPT_UEVENT | FW_OPT_NO_WARN |
-				 FW_OPT_NOFALLBACK_SYSFS);
+				 FW_OPT_NO_WARN | FW_OPT_NOFALLBACK_SYSFS);
 }
 EXPORT_SYMBOL_GPL(request_firmware_direct);
 
@@ -1073,7 +1071,7 @@  int request_firmware_platform(const struct firmware **firmware,
 			      const char *name, struct device *device)
 {
 	return _request_firmware(firmware, name, device, NULL, 0, 0,
-				 FW_OPT_UEVENT | FW_OPT_FALLBACK_PLATFORM);
+				 FW_OPT_FALLBACK_PLATFORM);
 }
 EXPORT_SYMBOL_GPL(request_firmware_platform);
 
@@ -1124,7 +1122,7 @@  request_firmware_into_buf(const struct firmware **firmware_p, const char *name,
 		return -EOPNOTSUPP;
 
 	return _request_firmware(firmware_p, name, device, buf, size, 0,
-				 FW_OPT_UEVENT | FW_OPT_NOCACHE);
+				 FW_OPT_NOCACHE);
 }
 EXPORT_SYMBOL(request_firmware_into_buf);
 
@@ -1149,8 +1147,7 @@  request_partial_firmware_into_buf(const struct firmware **firmware_p,
 		return -EOPNOTSUPP;
 
 	return _request_firmware(firmware_p, name, device, buf, size, offset,
-				 FW_OPT_UEVENT | FW_OPT_NOCACHE |
-				 FW_OPT_PARTIAL);
+				 FW_OPT_NOCACHE | FW_OPT_PARTIAL);
 }
 EXPORT_SYMBOL(request_partial_firmware_into_buf);