Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

platform/chrome: cros_typec_switch: Don't touch struct fwnode_handle::dev

The 'dev' field in struct fwnode is special and related to device links,
There no driver should use it for printing messages. Fix incorrect use
of private field.

Fixes: affc804c44c8 ("platform/chrome: cros_typec_switch: Add switch driver")
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20260120131413.1697891-2-andriy.shevchenko@linux.intel.com
Signed-off-by: Tzung-Bi Shih <tzungbi@kernel.org>

authored by

Andy Shevchenko and committed by
Tzung-Bi Shih
e1adf488 8f0b4cce

+3 -3
+3 -3
drivers/platform/chrome/cros_typec_switch.c
··· 230 230 231 231 adev = to_acpi_device_node(fwnode); 232 232 if (!adev) { 233 - dev_err(fwnode->dev, "Couldn't get ACPI device handle\n"); 233 + dev_err(dev, "Couldn't get ACPI device handle for %pfwP\n", fwnode); 234 234 ret = -ENODEV; 235 235 goto err_switch; 236 236 } 237 237 238 238 ret = acpi_evaluate_integer(adev->handle, "_ADR", NULL, &index); 239 239 if (ACPI_FAILURE(ret)) { 240 - dev_err(fwnode->dev, "_ADR wasn't evaluated\n"); 240 + dev_err(dev, "_ADR wasn't evaluated for %pfwP\n", fwnode); 241 241 ret = -ENODATA; 242 242 goto err_switch; 243 243 } 244 244 245 245 if (index >= EC_USB_PD_MAX_PORTS) { 246 - dev_err(fwnode->dev, "Invalid port index number: %llu\n", index); 246 + dev_err(dev, "%pfwP: Invalid port index number: %llu\n", fwnode, index); 247 247 ret = -EINVAL; 248 248 goto err_switch; 249 249 }