Re: [PATCH] Add intel drm blacklist to intel_opregion_present detect

Thomas Renninger
2010-08-23T14:13:30Z

On Monday 23 August 2010 13:40:48 Lee, Chun-Yi wrote:
> There have some machines not support by i915 drm driver, e.g. MSI U110/U150,
> there are use poulsbo chip and drm driver not support it because legal issue.
> Those machines's acpi backlight control actually work fine and don't need apply
> the intel opregion support.
> So, add intel drm blacklist to intel_opregion_present, it can enable the acpi
> brightness interface on Poulsbo/Morrestown.
>
> Signed-off-by: Lee, Chun-Yi <jlee@novell.com>
...
> @@ -2567,7 +2584,14 @@ static int __init intel_opregion_present(void)
> pci_read_config_dword(dev, 0xfc, &address);
> if (!address)
> continue;
> - return 1;
> + for (i = 0; intel_drm_blacklist[i].device != 0; i++) {
> + if (dev->device == intel_drm_blacklist[i].device) {
> + in_blacklist = 1;
> + break;
You can just return 0 here...
> + }
> + }
> + if (!in_blacklist)
> + return 1;
and get rid of in_blacklist variable.
Makes the code a bit easier to read.

Thomas