Re: [PATCH v1 2/7] ACPI: PM: Introduce acpi_device_init_power()
Andy Shevchenko <[email protected]>
| Newsgroups | org.kernel.vger.linux-acpi,org.kernel.vger.linux-kernel,org.kernel.vger.linux-pci,org.kernel.vger.linux-pm |
|---|---|
| Organization | Intel Finland Oy - BIC 0357606-4 - c/o Alberga Business Park, 6 krs, Bertel Jungin Aukio 5, 02600 Espoo |
| Message-ID | <[email protected]> |
On Mon, Aug 31, 2026 at 06:25:52PM +0200, Rafael J. Wysocki wrote:
> Two out of three callers of acpi_bus_init_power() need to clear
> flags.power_manageable for the target device on errors, which
> is somewhat cumbersome, so rename the function to
> __acpi_device_init_power(), add a wrapper called
> acpi_device_init_power() around it that will take care
> of the flags.power_manageable clearing, and make the two
> callers of acpi_bus_init_power() in question invoke that
> wrapper.
>
> While at it, clean up the declaration of local variables
> in __acpi_device_init_power().
...
> {
> - int state;
> - int result;
> + int result, state;
Not sure if this change is required.
> result = acpi_device_get_power(device, &state);
> if (result)
...
> +int acpi_device_init_power(struct acpi_device *device)
Ah, here is a helper!
> +{
> + int ret;
Elsewhere in the file it's called 'result'.
> +
> + ret = __acpi_device_init_power(device);
> + if (ret)
> + device->flags.power_manageable = 0;
> +
> + return ret;
> +}
--
With Best Regards,
Andy Shevchenko