platform/x86: intel: wmi: Use sysfs_emit and remove dead callbacks
PATCH 1/1 platform/x86: intel: wmi: Use sysfs_emit and remove dead callbacks
From: Arav Verma <[email protected]>
Modernize firmware_update_request_show by replacing legacy sprintf() call with sysfs_emit(). When altering string, also corrected format specifier from %d to %u to match u32 type of target variable.
Additionally, remove empty .probe and .remove callbacks from wmi_driver struct, as they were print-only and redundant.
--- drivers/platform/x86/intel/wmi/sbl-fw-update.c | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-)
drivers/platform/x86/intel/wmi/sbl-fw-update.c +1 -15
@@ -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,
@@ -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
Ilpo Järvinen
maintainerQuoted 9 lines · On Sun, 9 Aug 2026, [email protected] wrote:
From: Arav Verma <[email protected]>
Modernize
firmware_update_request_showby replacing legacysprintf()call withsysfs_emit(). When altering string, also corrected format specifier from %d to %u to match u32 type of target variable.Additionally, remove empty .probe and .remove callbacks from
wmi_driverstruct, as they were print-only and redundant.
Hi,
Please split these two entirely independent changes to two a patch series.
Always stop and reconsider when you have to say "Additionally,"; one almost always wants to add another patch into the series instead of writing that magic phrase.
Quoted 47 lines
Signed-off-by Arav Verma <[email protected]>--- drivers/platform/x86/intel/wmi/sbl-fw-update.c | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-)drivers/platform/x86/intel/wmi/sbl-fw-update.c +1
-15@@ -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,@@ -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
i.