Re: [PATCH v6 4/5] ACPI: ac: Add a blacklist with PMIC ACPI HIDs with a native charger driver

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

 



On Tue, 2017-04-18 at 13:58 +0200, Hans de Goede wrote:
> On some systems we have a native PMIC driver which provides Mains
> monitoring, while the ACPI ac driver is broken on these systems
> due to bad DSTDs or because we do not support the proprietary and
> undocumented ACPI opregions these ACPI battery devices rely on
> (e.g. BMOP opregion).
> 
> This leads for example to a ADP1 power_supply which reports
> itself as always online even if no mains are connected.
> 
> This commit adds a blacklist with PMIC ACPI HIDs for which we've a
> native charger or extcon driver and makes the ACPI ac driver not
> register itself when a PMIC on this list is present.

Same remark, change those minors if something else comes up.

>  static int __init acpi_ac_init(void)
>  {
> -	int result;
> +	int i, result;

I would go with

unsigned int i;

(Same for previous patch considering ARRAY_SIZE() in use)

>  
>  	if (acpi_disabled)
>  		return -ENODEV;
>  
> +	for (i = 0; i < ARRAY_SIZE(acpi_ac_blacklist); i++)
> +		if (acpi_dev_present(acpi_ac_blacklist[i].hid, "1",
> +				     acpi_ac_blacklist[i].hrv)) {

> +			pr_info("ACPI: AC: found native %s PMIC, not
> loading\n",

Do we have PREFIX defined in this module as well?

> +				acpi_ac_blacklist[i].hid);
> +			return -ENODEV;
> +		}
> +

-- 
Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>
Intel Finland Oy
--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[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