From 3ae5eaec1d2d9c0cf53745352e7d4b152810ba24 Mon Sep 17 00:00:00 2001 From: Russell King Date: Wed, 9 Nov 2005 22:32:44 +0000 Subject: [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 Acked-by: Greg Kroah-Hartman --- drivers/misc/hdpuftrs/hdpu_cpustate.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'drivers/misc/hdpuftrs/hdpu_cpustate.c') diff --git a/drivers/misc/hdpuftrs/hdpu_cpustate.c b/drivers/misc/hdpuftrs/hdpu_cpustate.c index 9c4dd682ac7..226a7cd4ee3 100644 --- a/drivers/misc/hdpuftrs/hdpu_cpustate.c +++ b/drivers/misc/hdpuftrs/hdpu_cpustate.c @@ -27,8 +27,8 @@ #define SKY_CPUSTATE_VERSION "1.1" -static int hdpu_cpustate_probe(struct device *ddev); -static int hdpu_cpustate_remove(struct device *ddev); +static int hdpu_cpustate_probe(struct platform_device *pdev); +static int hdpu_cpustate_remove(struct platform_device *pdev); struct cpustate_t cpustate; @@ -159,11 +159,12 @@ static int cpustate_read_proc(char *page, char **start, off_t off, return len; } -static struct device_driver hdpu_cpustate_driver = { - .name = HDPU_CPUSTATE_NAME, - .bus = &platform_bus_type, +static struct platform_driver hdpu_cpustate_driver = { .probe = hdpu_cpustate_probe, .remove = hdpu_cpustate_remove, + .driver = { + .name = HDPU_CPUSTATE_NAME, + }, }; /* @@ -188,9 +189,8 @@ static struct miscdevice cpustate_dev = { &cpustate_fops }; -static int hdpu_cpustate_probe(struct device *ddev) +static int hdpu_cpustate_probe(struct platform_device *pdev) { - struct platform_device *pdev = to_platform_device(ddev); struct resource *res; struct proc_dir_entry *proc_de; int ret; @@ -218,7 +218,7 @@ static int hdpu_cpustate_probe(struct device *ddev) return 0; } -static int hdpu_cpustate_remove(struct device *ddev) +static int hdpu_cpustate_remove(struct platform_device *pdev) { cpustate.set_addr = NULL; @@ -233,13 +233,13 @@ static int hdpu_cpustate_remove(struct device *ddev) static int __init cpustate_init(void) { int rc; - rc = driver_register(&hdpu_cpustate_driver); + rc = platform_driver_register(&hdpu_cpustate_driver); return rc; } static void __exit cpustate_exit(void) { - driver_unregister(&hdpu_cpustate_driver); + platform_driver_unregister(&hdpu_cpustate_driver); } module_init(cpustate_init); -- cgit v1.2.3