Re: [PATCH 4/4] ACPI / platform: Use struct acpi_scan_handler forcreating devices

From: Mika Westerberg
Date: Tue Jan 29 2013 - 03:01:34 EST


On Mon, Jan 28, 2013 at 02:01:14PM +0100, Rafael J. Wysocki wrote:
> +/* Flags for acpi_create_platform_device */
> +#define ACPI_PLATFORM_CLK BIT(0)
> +
> +/*
> + * The following ACPI IDs are known to be suitable for representing as
> + * platform devices.
> + */
> +static const struct acpi_device_id acpi_platform_device_ids[] = {
> +
> + { "PNP0D40" },
> +
> + /* Haswell LPSS devices */
> + { "INT33C0", ACPI_PLATFORM_CLK },
> + { "INT33C1", ACPI_PLATFORM_CLK },
> + { "INT33C2", ACPI_PLATFORM_CLK },
> + { "INT33C3", ACPI_PLATFORM_CLK },
> + { "INT33C4", ACPI_PLATFORM_CLK },
> + { "INT33C5", ACPI_PLATFORM_CLK },
> + { "INT33C6", ACPI_PLATFORM_CLK },
> + { "INT33C7", ACPI_PLATFORM_CLK },
> +
> + { }
> +};

Now that we have everything the platform support code needs in a single
file, should we instead of setting flags and comparing strings like
"INT33C" to find out are we running on Lynxpoint, pass function pointer
that gets called when corresponding device gets created? Something like:

{ "INT33C0", lpt_clks_init },
...

Or do you think we need to keep the flags still?

I can prepare a patch if this turns out to be sensible thing to do.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/