aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/platform/x86/serdev_helpers.h
diff options
context:
space:
mode:
authorHans de Goede <[email protected]>2024-12-04 20:42:14 +0000
committerIlpo Järvinen <[email protected]>2024-12-10 13:17:47 +0000
commit478b00a623d6c8ae23a1be7bcc96cb5497045cef (patch)
treedcb4c150537648fcd8b2af562375003fe11c7bfd /drivers/platform/x86/serdev_helpers.h
parentplatform/x86: x86-android-tablets: Make variables only used locally static (diff)
downloadkernel-478b00a623d6c8ae23a1be7bcc96cb5497045cef.tar.gz
kernel-478b00a623d6c8ae23a1be7bcc96cb5497045cef.zip
platform/x86: serdev_helpers: Check for serial_ctrl_uid == NULL
dell_uart_bl_pdev_probe() calls get_serdev_controller() with the serial_ctrl_uid parameter set to NULL. In case of errors this NULL parameter then gets passed to pr_err() as argument matching a "%s" conversion specification. This leads to compiler warnings when building with "make W=1". Check serial_ctrl_uid before passing it to pr_err() to avoid these. Fixes: dc5afd720f84 ("platform/x86: Add new get_serdev_controller() helper") Cc: [email protected] Suggested-by: Ilpo Järvinen <[email protected]> Signed-off-by: Hans de Goede <[email protected]> Reviewed-by: Andy Shevchenko <[email protected]> Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Ilpo Järvinen <[email protected]> Signed-off-by: Ilpo Järvinen <[email protected]>
Diffstat (limited to 'drivers/platform/x86/serdev_helpers.h')
-rw-r--r--drivers/platform/x86/serdev_helpers.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/platform/x86/serdev_helpers.h b/drivers/platform/x86/serdev_helpers.h
index bcf3a0c356ea..3bc7fd8e1e19 100644
--- a/drivers/platform/x86/serdev_helpers.h
+++ b/drivers/platform/x86/serdev_helpers.h
@@ -35,7 +35,7 @@ get_serdev_controller(const char *serial_ctrl_hid,
ctrl_adev = acpi_dev_get_first_match_dev(serial_ctrl_hid, serial_ctrl_uid, -1);
if (!ctrl_adev) {
pr_err("error could not get %s/%s serial-ctrl adev\n",
- serial_ctrl_hid, serial_ctrl_uid);
+ serial_ctrl_hid, serial_ctrl_uid ?: "*");
return ERR_PTR(-ENODEV);
}
@@ -43,7 +43,7 @@ get_serdev_controller(const char *serial_ctrl_hid,
ctrl_dev = get_device(acpi_get_first_physical_node(ctrl_adev));
if (!ctrl_dev) {
pr_err("error could not get %s/%s serial-ctrl physical node\n",
- serial_ctrl_hid, serial_ctrl_uid);
+ serial_ctrl_hid, serial_ctrl_uid ?: "*");
ctrl_dev = ERR_PTR(-ENODEV);
goto put_ctrl_adev;
}