X-Git-Url: http://pilppa.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=drivers%2Fmisc%2Fhdpuftrs%2Fhdpu_nexus.c;h=6a51e99a8079995adfb9183a0af21108eb0705ff;hb=f110ef58e6c9bd562999247c5e8a5b8e722fbd11;hp=4bb461793851c0d704b8ac320a000571051f10ac;hpb=3b621ee5df437d3f332a635ab6421aaa61a7dc2b;p=linux-2.6-omap-h63xx.git diff --git a/drivers/misc/hdpuftrs/hdpu_nexus.c b/drivers/misc/hdpuftrs/hdpu_nexus.c index 4bb46179385..6a51e99a807 100644 --- a/drivers/misc/hdpuftrs/hdpu_nexus.c +++ b/drivers/misc/hdpuftrs/hdpu_nexus.c @@ -22,19 +22,20 @@ #include -static int hdpu_nexus_probe(struct device *ddev); -static int hdpu_nexus_remove(struct device *ddev); +static int hdpu_nexus_probe(struct platform_device *pdev); +static int hdpu_nexus_remove(struct platform_device *pdev); static struct proc_dir_entry *hdpu_slot_id; static struct proc_dir_entry *hdpu_chassis_id; static int slot_id = -1; static int chassis_id = -1; -static struct device_driver hdpu_nexus_driver = { - .name = HDPU_NEXUS_NAME, - .bus = &platform_bus_type, +static struct platform_driver hdpu_nexus_driver = { .probe = hdpu_nexus_probe, .remove = hdpu_nexus_remove, + .driver = { + .name = HDPU_NEXUS_NAME, + }, }; int hdpu_slot_id_read(char *buffer, char **buffer_location, off_t offset, @@ -55,9 +56,8 @@ int hdpu_chassis_id_read(char *buffer, char **buffer_location, off_t offset, return sprintf(buffer, "%d\n", chassis_id); } -static int hdpu_nexus_probe(struct device *ddev) +static int hdpu_nexus_probe(struct platform_device *pdev) { - struct platform_device *pdev = to_platform_device(ddev); struct resource *res; res = platform_get_resource(pdev, IORESOURCE_MEM, 0); @@ -72,15 +72,13 @@ static int hdpu_nexus_probe(struct device *ddev) printk("Could not map slot id\n"); hdpu_slot_id = create_proc_entry("sky_slot_id", 0666, &proc_root); hdpu_slot_id->read_proc = hdpu_slot_id_read; - hdpu_slot_id->nlink = 1; hdpu_chassis_id = create_proc_entry("sky_chassis_id", 0666, &proc_root); hdpu_chassis_id->read_proc = hdpu_chassis_id_read; - hdpu_chassis_id->nlink = 1; return 0; } -static int hdpu_nexus_remove(struct device *ddev) +static int hdpu_nexus_remove(struct platform_device *pdev) { slot_id = -1; chassis_id = -1; @@ -94,13 +92,13 @@ static int hdpu_nexus_remove(struct device *ddev) static int __init nexus_init(void) { int rc; - rc = driver_register(&hdpu_nexus_driver); + rc = platform_driver_register(&hdpu_nexus_driver); return rc; } static void __exit nexus_exit(void) { - driver_unregister(&hdpu_nexus_driver); + platform_driver_unregister(&hdpu_nexus_driver); } module_init(nexus_init);