Re: [PATCH 1/2] platform/x86: x86-android-tablets: Fix Lenovo Yoga Tablet 2 830/1050 poweroff again

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 7/8/22 16:14, Hans de Goede wrote:
> @@ -950,13 +953,19 @@ static int __init lenovo_yoga_tab2_830_1050_init(void)
>  	if (ret)
>  		return ret;
>  
> -	pm_power_off = lenovo_yoga_tab2_830_1050_power_off;
> +	/* SYS_OFF_PRIO_FIRMWARE + 1 so that it runs before acpi_power_off */
> +	lenovo_yoga_tab2_830_1050_sys_off_handler =
> +		register_sys_off_handler(SYS_OFF_MODE_POWER_OFF, SYS_OFF_PRIO_FIRMWARE + 1,
> +					 lenovo_yoga_tab2_830_1050_power_off, NULL);
> +	if (IS_ERR(lenovo_yoga_tab2_830_1050_sys_off_handler))
> +		return PTR_ERR(lenovo_yoga_tab2_830_1050_sys_off_handler);

Please note that technically we could ignore the registration error
(maybe print error message) and allow the rest of the module to work
without the power-off.

The unregister_sys_off_handler() will skip the ERR_PTR handler.

-- 
Best regards,
Dmitry



[Index of Archives]     [Linux IBM ACPI]     [Linux Power Management]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux