cbus/retu.c : Use platform_driver
PATCH 6/6 cbus/retu.c : Use platform_driver
Use platform_driver
Signed-off-by Komal Shah <[email protected]>
---Komal Shah
http://komalshah.blogspot.com/
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
drivers/cbus/retu.c +13 -10
@@ -293,7 +293,7 @@ static void retu_power_off(void)* Probe for the Retu ASIC and allocate memory * for its device-struct if found */ -static int __devinit retu_probe (struct device *dev) +static int __devinit retu_probe (struct platform_driver *pdev) {const struct omap_em_asic_bb5_config * em_asic_config;int rev, ret;
@@ -358,7 +358,7 @@ static int __devinit retu_probe(struct dreturn 0 ; } -static int retu_remove (struct device *dev) +static int retu_remove (struct platform_driver *pdev) {#ifdef CONFIG_CBUS_RETU_USER retu_user_cleanup ();
@@ -377,11 +377,12 @@ static void retu_device_release(struct dcomplete (&device_release); } -static struct device_driver retu_driver = { - .name ="retu" , - .bus = &platform_bus_type, +static struct platform_driver retu_driver = { .probe = retu_probe, .remove = retu_remove, + .driver = { + .name ="retu" , + }, };static struct platform_device retu_device = {
@@ -392,6 +393,8 @@ static struct platform_device retu_devic } }; +static char banner[]__initdata =KERN_INFO "Retu/Vilma driver initialising\n" ; +/** * retu_init - initialise Retu driver *
@@ -401,15 +404,15 @@ static int __init retu_init(void) {int ret =0 ; -printk (KERN_INFO "Retu/Vilma driver initialising\n" ); - +printk (banner); +init_completion (&device_release); -if ((ret =driver_register (&retu_driver)) <0 ) +if ((ret =platform_driver_register (&retu_driver)) <0 )return ret;if ((ret =platform_device_register (&retu_device)) <0 ) { -driver_unregister (&retu_driver); +platform_driver_unregister (&retu_driver);return ret; }return 0 ;
@@ -421,7 +424,7 @@ static int __init retu_init(void) static void __exit retu_exit(void) {platform_device_unregister (&retu_device); -driver_unregister (&retu_driver); +platform_driver_unregister (&retu_driver);wait_for_completion (&device_release); }