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: Use acpi_get_local_u64_address()

Now we have a helper so there's no need to open-code.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20260120131413.1697891-3-andriy.shevchenko@linux.intel.com
Signed-off-by: Tzung-Bi Shih <tzungbi@kernel.org>

authored by

Andy Shevchenko and committed by
Tzung-Bi Shih
a4065662 e1adf488

+3 -12
+3 -12
drivers/platform/chrome/cros_typec_switch.c
··· 211 211 struct cros_typec_port *port; 212 212 struct device *dev = sdata->dev; 213 213 struct fwnode_handle *fwnode; 214 - struct acpi_device *adev; 215 - unsigned long long index; 216 214 int nports, ret; 215 + u64 index; 217 216 218 217 nports = device_get_child_node_count(dev); 219 218 if (nports == 0) { ··· 227 228 goto err_switch; 228 229 } 229 230 230 - adev = to_acpi_device_node(fwnode); 231 - if (!adev) { 232 - dev_err(dev, "Couldn't get ACPI device handle for %pfwP\n", fwnode); 233 - ret = -ENODEV; 234 - goto err_switch; 235 - } 236 - 237 - ret = acpi_evaluate_integer(adev->handle, "_ADR", NULL, &index); 238 - if (ACPI_FAILURE(ret)) { 231 + ret = acpi_get_local_u64_address(ACPI_HANDLE_FWNODE(fwnode), &index); 232 + if (ret) { 239 233 dev_err(dev, "_ADR wasn't evaluated for %pfwP\n", fwnode); 240 - ret = -ENODATA; 241 234 goto err_switch; 242 235 } 243 236