lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <201107051650.19178.arnd@arndb.de>
Date:	Tue, 5 Jul 2011 16:50:18 +0200
From:	Arnd Bergmann <arnd@...db.de>
To:	ashish.jangam@...tcummins.com
Cc:	rpurdie@...ys.net, tfransosi@...il.com,
	linux-kernel@...r.kernel.org, linaro-dev@...ts.linaro.org,
	dchen@...semi.com
Subject: Re: [PATCH 9/11] Backlight: DA9052 Backlight driver v1

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@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ