Skip to contentSkip to conversation

docs: driver-api: firmware_loader: fix missing argument in usage example

PATCH In review Conor Dooley 2 participants 2 messages Mar 29, 2023 Documentation

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 docs: driver-api: firmware_loader: fix missing argument in usage example

By the time firmware-upload support landed in commit 97730bbb242c ("firmware_loader: Add firmware-upload support"), the arguments for firmware_upload_register() had changed, and while this is automagically represented in the kernel doc bits, the usage example was not kept in sync.
Add the missing argument as per the driver.

Fixes 97730bbb242c ("firmware_loader: Add firmware-upload support")

---
From skimming the threads adding this stuff, looks like THIS_MODULE was always needed, so either I'm missing something or the doc stuff wasn't matching in any of the submitted versions.

CC Jonathan Corbet <[email protected]>
CC Russ Weight <[email protected]>
CC Greg Kroah-Hartman <[email protected]>
CC Tianfei zhang <[email protected]>
CC Luis Chamberlain <[email protected]>
---
 Documentation/driver-api/firmware/fw_upload.rst | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
Documentation/driver-api/firmware/fw_upload.rst +2 -1
index 76922591e446..edf1d0c5e7c3 100644
@@ -57,7 +57,8 @@ function calls firmware_upload_unregister() such as::
 		len = (truncate) ? truncate - fw_name : strlen(fw_name);
 		sec->fw_name = kmemdup_nul(fw_name, len, GFP_KERNEL);
 
-		fwl = firmware_upload_register(sec->dev, sec->fw_name, &m10bmc_ops, sec);
+		fwl = firmware_upload_register(THIS_MODULE, sec->dev, sec->fw_name,
+					       &m10bmc_ops, sec);
 		if (IS_ERR(fwl)) {
 			dev_err(sec->dev, "Firmware Upload driver failed to start\n");
 			kfree(sec->fw_name);
Signature · 1 line
2.39.2
#1 lore raw
Quoted 30 lines · Conor Dooley

By the time firmware-upload support landed in commit 97730bbb242c ("firmware_loader: Add firmware-upload support"), the arguments for firmware_upload_register() had changed, and while this is automagically represented in the kernel doc bits, the usage example was not kept in sync.
Add the missing argument as per the driver.

Fixes 97730bbb242c ("firmware_loader: Add firmware-upload support")

---

Quoted 1 line

From skimming the threads adding this stuff, looks like THIS_MODULE was

always needed, so either I'm missing something or the doc stuff wasn't matching in any of the submitted versions.

CC Jonathan Corbet <[email protected]>
CC Russ Weight <[email protected]>
CC Greg Kroah-Hartman <[email protected]>
CC Tianfei zhang <[email protected]>
CC Luis Chamberlain <[email protected]>
---
 Documentation/driver-api/firmware/fw_upload.rst | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
Documentation/driver-api/firmware/fw_upload.rst +0 -0
index 76922591e446..edf1d0c5e7c3 100644

Documentation/driver-api/firmware/fw_upload.rst function calls firmware_upload_unregister() such as:: · line 61

Quoted 6 lines
Documentation/driver-api/firmware/fw_upload.rst +2 -1
@@ -57,7 +57,8 @@ function calls firmware_upload_unregister() such as::
 		len = (truncate) ? truncate - fw_name : strlen(fw_name);
 		sec->fw_name = kmemdup_nul(fw_name, len, GFP_KERNEL);
 
-		fwl = firmware_upload_register(sec->dev, sec->fw_name, &m10bmc_ops, sec);
+		fwl = firmware_upload_register(THIS_MODULE, sec->dev, sec->fw_name,
+					       &m10bmc_ops, sec);

Good catch. As this touches the firmware documentation, I can take it in my tree, thanks!

greg k-h