Hi,

On Mon, Oct 18, 2010 at 11:07:43PM +0800, Lee, Chun-Yi wrote:
> +static void type_aa_dmi_decode(const struct dmi_header *header, void *dummy)
> +{
> +     /* We are looking for OEM-specific Type Aah */
> +     if (header->type != ACER_DMI_DEV_TYPE_AA)
> +             return;
> +
> +     type_aa = (struct hotkey_function_type_aa *) header;
> +
> +     printk(ACER_INFO "Function biti map for Communication Button: 0x%x\n",
> +             type_aa->commun_func_bitmap);
> +     if (!!(type_aa->commun_func_bitmap & ACER_WMID3_GDS_WIRELESS))
> +             interface->capability |= ACER_CAP_WIRELESS;
> +     if (!!(type_aa->commun_func_bitmap & ACER_WMID3_GDS_THREEG))
> +             interface->capability |= ACER_CAP_THREEG;
> +     if (!!(type_aa->commun_func_bitmap & ACER_WMID3_GDS_BLUETOOTH))
> +             interface->capability |= ACER_CAP_BLUETOOTH;

The "!!" is completely redundant here.

> +}
> +
>  static acpi_status WMID_set_capabilities(void)
>  {
>       struct acpi_buffer out = {ACPI_ALLOCATE_BUFFER, NULL};
> @@ -844,16 +875,17 @@ static acpi_status WMID_set_capabilities(void)
>               return AE_ERROR;
>       }
>  
> -     /* Not sure on the meaning of the relevant bits yet to detect these */
> -     interface->capability |= ACER_CAP_WIRELESS;
> -     interface->capability |= ACER_CAP_THREEG;
> +     dmi_walk(type_aa_dmi_decode, NULL);
> +     if (!type_aa) {
> +             interface->capability |= ACER_CAP_WIRELESS;
> +             interface->capability |= ACER_CAP_THREEG;
> +             if (devices & 0x10)
> +                     interface->capability |= ACER_CAP_BLUETOOTH;
> +     }

Since you are storing "type_aa" anyways it probably would be better to
set all capabilities here, in one place...

Thanks.

-- 
Dmitry
--
To unsubscribe from this list: send the line "unsubscribe platform-driver-x86" 
in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to