[DRIVER MODEL] Convert platform drivers to use struct platform_driver
This allows us to eliminate the casts in the drivers, and eventually remove the use of the device_driver function pointer methods for platform device drivers. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk> Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
committed by
Russell King
parent
00d3dcdd96
commit
3ae5eaec1d
@@ -32,7 +32,7 @@
|
||||
#include <sound/initval.h>
|
||||
#include <linux/kmod.h>
|
||||
#include <linux/devfs_fs_kernel.h>
|
||||
#include <linux/device.h>
|
||||
#include <linux/platform_device.h>
|
||||
|
||||
#define SNDRV_OS_MINORS 256
|
||||
|
||||
@@ -329,7 +329,7 @@ int __exit snd_minor_info_done(void)
|
||||
*/
|
||||
|
||||
#ifdef CONFIG_SND_GENERIC_DRIVER
|
||||
extern struct device_driver snd_generic_driver;
|
||||
extern struct platform_driver snd_generic_driver;
|
||||
#endif
|
||||
|
||||
static int __init alsa_sound_init(void)
|
||||
@@ -357,7 +357,7 @@ static int __init alsa_sound_init(void)
|
||||
}
|
||||
snd_info_minor_register();
|
||||
#ifdef CONFIG_SND_GENERIC_DRIVER
|
||||
driver_register(&snd_generic_driver);
|
||||
platform_driver_register(&snd_generic_driver);
|
||||
#endif
|
||||
for (controlnum = 0; controlnum < cards_limit; controlnum++)
|
||||
devfs_mk_cdev(MKDEV(major, controlnum<<5), S_IFCHR | device_mode, "snd/controlC%d", controlnum);
|
||||
@@ -375,7 +375,7 @@ static void __exit alsa_sound_exit(void)
|
||||
devfs_remove("snd/controlC%d", controlnum);
|
||||
|
||||
#ifdef CONFIG_SND_GENERIC_DRIVER
|
||||
driver_unregister(&snd_generic_driver);
|
||||
platform_driver_unregister(&snd_generic_driver);
|
||||
#endif
|
||||
snd_info_minor_unregister();
|
||||
snd_info_done();
|
||||
|
Reference in New Issue
Block a user