Skip to contentSkip to conversation

platform/x86: intel: wmi: Use sysfs_emit in sbl-fw-update

PATCH In review Arav Verma 2 participants 3 messages Sep 23 – Oct 5

Subsystems (2)
lore
Share & tools
lore

Arav Verma

author
#0 lore raw

PATCH v4 1/2 platform/x86: intel: wmi: Use sysfs_emit in sbl-fw-update

Modernize firmware_update_request_show by replacing legacy sprintf() call with sysfs_emit. When altering string, corrected format specified from %d to %u to match u32 type of target variable.

---
v4: Added missing Signed-off-by tag.
v3: Resending as v3 due to git send-email formatting error, no code changes have been made.

 drivers/platform/x86/intel/wmi/sbl-fw-update.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/platform/x86/intel/wmi/sbl-fw-update.c +1 -1
index 62c9c7f1842ba..cfef71f4f3284 100644
@@ -61,7 +61,7 @@ static ssize_t firmware_update_request_show(struct device *dev,
 	if (ret)
 		return ret;
 
-	return sprintf(buf, "%d\n", val);
+	return sysfs_emit(buf, "%u\n", val);
 }
 
 static ssize_t firmware_update_request_store(struct device *dev,
Signature · 1 line
2.47.3
author
#1 lore raw

PATCH v4 2/2 platform/x86: intel: wmi: Remove redundant callbacks

Removed redundant .probe and .remove callbacks from wmi_driver struct, as they were print-only and unnecessary

---
v4: Added missing Signed-off-by tag.
v3: Resending as v3 due to git send-email formatting error, no code changes have been made.

 drivers/platform/x86/intel/wmi/sbl-fw-update.c | 14 --------------
 1 file changed, 14 deletions(-)
drivers/platform/x86/intel/wmi/sbl-fw-update.c +0 -14
index cfef71f4f3284..7e07cfab227c8 100644
@@ -93,18 +93,6 @@ static struct attribute *firmware_update_attrs[] = {
 };
 ATTRIBUTE_GROUPS(firmware_update);
 
-static int intel_wmi_sbl_fw_update_probe(struct wmi_device *wdev,
-					 const void *context)
-{
-	dev_info(&wdev->dev, "Slim Bootloader signaling driver attached\n");
-	return 0;
-}
-
-static void intel_wmi_sbl_fw_update_remove(struct wmi_device *wdev)
-{
-	dev_info(&wdev->dev, "Slim Bootloader signaling driver removed\n");
-}
-
 static const struct wmi_device_id intel_wmi_sbl_id_table[] = {
 	{ .guid_string = INTEL_WMI_SBL_GUID },
 	{}
@@ -116,8 +104,6 @@ static struct wmi_driver intel_wmi_sbl_fw_update_driver = {
 		.name = "intel-wmi-sbl-fw-update",
 		.dev_groups = firmware_update_groups,
 	},
-	.probe = intel_wmi_sbl_fw_update_probe,
-	.remove = intel_wmi_sbl_fw_update_remove,
 	.id_table = intel_wmi_sbl_id_table,
 	.no_singleton = true,
 };
Signature · 1 line
2.47.3
maintainer
#2 lore raw
In reply to Arav Verma
Quoted 4 lines · Arav Verma

Modernize firmware_update_request_show by replacing legacy sprintf() call with sysfs_emit. When altering string, corrected format specified from %d to %u to match u32 type of target variable.

Thank you for your contribution, it has been applied to my local review-ilpo-next branch. Note it will show up in the public platform-drivers-x86/review-ilpo-next branch only once I've pushed my local branch there, which might take a while.

FYI [if applicable to your patch], as per Linus' policy change, also fixes are mostly routed through for-next unless the fix is for a commit introduced in the most recent cycle or is clearly a regression fix.

The list of commits applied:
[1/2] platform/x86: intel: wmi: Use sysfs_emit in sbl-fw-update

      commit: cfcedb39eb6ce3b4914e70fc5506c0bbe08f1039
[2/2] platform/x86: intel: wmi: Remove redundant callbacks
      commit: f866fb6769754d1c07ade90ba22033bee6e55a71

--
i.