X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=drivers%2Fmtd%2Fmaps%2Fintegrator-flash.c;h=a3ba52fbd86835968bc01a3c9ffe053641265d25;hb=43bc926fffd92024b46cafaf7350d669ba9ca884;hp=1f23ab1cd8820e5b58f48ffe127b457051f5a802;hpb=9bf4aaab3e101692164d49b7ca357651eb691cb6;p=linux-2.6.git diff --git a/drivers/mtd/maps/integrator-flash.c b/drivers/mtd/maps/integrator-flash.c index 1f23ab1cd..a3ba52fbd 100644 --- a/drivers/mtd/maps/integrator-flash.c +++ b/drivers/mtd/maps/integrator-flash.c @@ -1,28 +1,28 @@ /*====================================================================== drivers/mtd/maps/integrator-flash.c: ARM Integrator flash map driver - + Copyright (C) 2000 ARM Limited Copyright (C) 2003 Deep Blue Solutions Ltd. - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - This is access code for flashes using ARM's flash partitioning + + This is access code for flashes using ARM's flash partitioning standards. - $Id: integrator-flash.c,v 1.16 2004/07/12 21:59:44 dwmw2 Exp $ + $Id: integrator-flash.c,v 1.20 2005/11/07 11:14:27 gleixner Exp $ ======================================================================*/ @@ -32,7 +32,7 @@ #include #include #include -#include +#include #include #include @@ -67,15 +67,14 @@ static void armflash_set_vpp(struct map_info *map, int on) static const char *probes[] = { "cmdlinepart", "RedBoot", "afs", NULL }; -static int armflash_probe(struct device *_dev) +static int armflash_probe(struct platform_device *dev) { - struct platform_device *dev = to_platform_device(_dev); struct flash_platform_data *plat = dev->dev.platform_data; struct resource *res = dev->resource; unsigned int size = res->end - res->start + 1; struct armflash_info *info; int err; - void *base; + void __iomem *base; info = kmalloc(sizeof(struct armflash_info), GFP_KERNEL); if (!info) { @@ -110,7 +109,7 @@ static int armflash_probe(struct device *_dev) info->map.size = size; info->map.bankwidth = plat->width; info->map.phys = res->start; - info->map.virt = (unsigned long) base; + info->map.virt = base; info->map.name = dev->dev.bus_id; info->map.set_vpp = armflash_set_vpp; @@ -138,7 +137,7 @@ static int armflash_probe(struct device *_dev) } if (err == 0) - dev_set_drvdata(&dev->dev, info); + platform_set_drvdata(dev, info); /* * If we got an error, free all resources. @@ -148,8 +147,7 @@ static int armflash_probe(struct device *_dev) del_mtd_partitions(info->mtd); map_destroy(info->mtd); } - if (info->parts) - kfree(info->parts); + kfree(info->parts); no_device: iounmap(base); @@ -164,22 +162,20 @@ static int armflash_probe(struct device *_dev) return err; } -static int armflash_remove(struct device *_dev) +static int armflash_remove(struct platform_device *dev) { - struct platform_device *dev = to_platform_device(_dev); - struct armflash_info *info = dev_get_drvdata(&dev->dev); + struct armflash_info *info = platform_get_drvdata(dev); - dev_set_drvdata(&dev->dev, NULL); + platform_set_drvdata(dev, NULL); if (info) { if (info->mtd) { del_mtd_partitions(info->mtd); map_destroy(info->mtd); } - if (info->parts) - kfree(info->parts); + kfree(info->parts); - iounmap((void *)info->map.virt); + iounmap(info->map.virt); release_resource(info->res); kfree(info->res); @@ -192,21 +188,22 @@ static int armflash_remove(struct device *_dev) return 0; } -static struct device_driver armflash_driver = { - .name = "armflash", - .bus = &platform_bus_type, +static struct platform_driver armflash_driver = { .probe = armflash_probe, .remove = armflash_remove, + .driver = { + .name = "armflash", + }, }; static int __init armflash_init(void) { - return driver_register(&armflash_driver); + return platform_driver_register(&armflash_driver); } static void __exit armflash_exit(void) { - driver_unregister(&armflash_driver); + platform_driver_unregister(&armflash_driver); } module_init(armflash_init);