X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=drivers%2Fmtd%2Fmaps%2Fintegrator-flash.c;h=a3ba52fbd86835968bc01a3c9ffe053641265d25;hb=43bc926fffd92024b46cafaf7350d669ba9ca884;hp=e39a98a0171c801b44b0eec73730d2ebb8df5120;hpb=6a77f38946aaee1cd85eeec6cf4229b204c15071;p=linux-2.6.git diff --git a/drivers/mtd/maps/integrator-flash.c b/drivers/mtd/maps/integrator-flash.c index e39a98a01..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.18 2004/11/01 13:26:15 rmk 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,9 +67,8 @@ 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; @@ -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,20 +162,18 @@ 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(info->map.virt); release_resource(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);