diff options
author | Russell King <rmk@dyn-67.arm.linux.org.uk> | 2005-11-09 22:32:44 +0000 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2005-11-09 22:32:44 +0000 |
commit | 3ae5eaec1d2d9c0cf53745352e7d4b152810ba24 (patch) | |
tree | d8825be54cefb6ad6707478d719c8e30605bee7b /sound/core/init.c | |
parent | 00d3dcdd96646be6059cc21f2efa94c4edc1eda5 (diff) |
[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>
Diffstat (limited to 'sound/core/init.c')
-rw-r--r-- | sound/core/init.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/sound/core/init.c b/sound/core/init.c index d9ee27ae9a51..33813f92ab52 100644 --- a/sound/core/init.c +++ b/sound/core/init.c @@ -674,23 +674,24 @@ struct snd_generic_device { snd_card_t *card; }; -#define get_snd_generic_card(dev) container_of(to_platform_device(dev), struct snd_generic_device, pdev)->card +#define get_snd_generic_card(dev) container_of(dev, struct snd_generic_device, pdev)->card #define SND_GENERIC_NAME "snd_generic" #ifdef CONFIG_PM -static int snd_generic_suspend(struct device *dev, pm_message_t state); -static int snd_generic_resume(struct device *dev); +static int snd_generic_suspend(struct platform_device *dev, pm_message_t state); +static int snd_generic_resume(struct platform_device *dev); #endif /* initialized in sound.c */ -struct device_driver snd_generic_driver = { - .name = SND_GENERIC_NAME, - .bus = &platform_bus_type, +struct platform_driver snd_generic_driver = { #ifdef CONFIG_PM .suspend = snd_generic_suspend, .resume = snd_generic_resume, #endif + .driver = { + .name = SND_GENERIC_NAME, + }, }; void snd_generic_device_release(struct device *dev) @@ -821,7 +822,7 @@ int snd_card_set_pm_callback(snd_card_t *card, #ifdef CONFIG_SND_GENERIC_DRIVER /* suspend/resume callbacks for snd_generic platform device */ -static int snd_generic_suspend(struct device *dev, pm_message_t state) +static int snd_generic_suspend(struct platform_device *dev, pm_message_t state) { snd_card_t *card; @@ -834,7 +835,7 @@ static int snd_generic_suspend(struct device *dev, pm_message_t state) return 0; } -static int snd_generic_resume(struct device *dev) +static int snd_generic_resume(struct platform_device *dev) { snd_card_t *card; |