Re: [PATCH 9/11] Backlight: DA9052 Backlight driver v1

From: Arnd Bergmann
Date: Tue Jul 05 2011 - 10:50:38 EST


On Tuesday 28 June 2011, ashishj3 wrote:
> +static struct platform_driver da9052_wled1_driver = {
> + .probe = da9052_backlight_probe,
> + .remove = da9052_backlight_remove,
> + .driver = {
> + .name = "da9052-WLED1",
> + .owner = THIS_MODULE,
> + },
> +};
> +
> +static struct platform_driver da9052_wled2_driver = {
> + .probe = da9052_backlight_probe,
> + .remove = da9052_backlight_remove,
> + .driver = {
> + .name = "da9052-WLED2",
> + .owner = THIS_MODULE,
> + },
> +};
> +
> +static struct platform_driver da9052_wled3_driver = {
> + .probe = da9052_backlight_probe,
> + .remove = da9052_backlight_remove,
> + .driver = {
> + .name = "da9052-WLED3",
> + .owner = THIS_MODULE,
> + },
> +};
> +
> +static int __init da9052_backlight_init(void)
> +{
> + int ret;
> +
> + ret = platform_driver_register(&da9052_wled1_driver);
> + if (ret)
> + return ret;
> +
> + ret = platform_driver_register(&da9052_wled2_driver);
> + if (ret)
> + return ret;
> +
> + ret = platform_driver_register(&da9052_wled3_driver);
> + if (ret)
> + return ret;
> +
> + return 0;
> +}
> +module_init(da9052_backlight_init);

As mentioned before, you should only need to register a single driver
for these three devices: Either you name them all the same and just
give the individual devices a different platform_device->id, or
you leave them with different names and add a platform_driver->id_table
to match them all.

Arnd
--
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/