diff options
Diffstat (limited to 'drivers/mtd/maps/omap_nor.c')
-rw-r--r-- | drivers/mtd/maps/omap_nor.c | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/drivers/mtd/maps/omap_nor.c b/drivers/mtd/maps/omap_nor.c index fd3b4a5fc207..418afffb2d80 100644 --- a/drivers/mtd/maps/omap_nor.c +++ b/drivers/mtd/maps/omap_nor.c | |||
@@ -70,11 +70,10 @@ static void omap_set_vpp(struct map_info *map, int enable) | |||
70 | } | 70 | } |
71 | } | 71 | } |
72 | 72 | ||
73 | static int __devinit omapflash_probe(struct device *dev) | 73 | static int __devinit omapflash_probe(struct platform_device *pdev) |
74 | { | 74 | { |
75 | int err; | 75 | int err; |
76 | struct omapflash_info *info; | 76 | struct omapflash_info *info; |
77 | struct platform_device *pdev = to_platform_device(dev); | ||
78 | struct flash_platform_data *pdata = pdev->dev.platform_data; | 77 | struct flash_platform_data *pdata = pdev->dev.platform_data; |
79 | struct resource *res = pdev->resource; | 78 | struct resource *res = pdev->resource; |
80 | unsigned long size = res->end - res->start + 1; | 79 | unsigned long size = res->end - res->start + 1; |
@@ -119,7 +118,7 @@ static int __devinit omapflash_probe(struct device *dev) | |||
119 | #endif | 118 | #endif |
120 | add_mtd_device(info->mtd); | 119 | add_mtd_device(info->mtd); |
121 | 120 | ||
122 | dev_set_drvdata(&pdev->dev, info); | 121 | platform_set_drvdata(pdev, info); |
123 | 122 | ||
124 | return 0; | 123 | return 0; |
125 | 124 | ||
@@ -133,12 +132,11 @@ out_free_info: | |||
133 | return err; | 132 | return err; |
134 | } | 133 | } |
135 | 134 | ||
136 | static int __devexit omapflash_remove(struct device *dev) | 135 | static int __devexit omapflash_remove(struct platform_device *pdev) |
137 | { | 136 | { |
138 | struct platform_device *pdev = to_platform_device(dev); | 137 | struct omapflash_info *info = platform_get_drvdata(pdev); |
139 | struct omapflash_info *info = dev_get_drvdata(&pdev->dev); | ||
140 | 138 | ||
141 | dev_set_drvdata(&pdev->dev, NULL); | 139 | platform_set_drvdata(pdev, NULL); |
142 | 140 | ||
143 | if (info) { | 141 | if (info) { |
144 | if (info->parts) { | 142 | if (info->parts) { |
@@ -155,21 +153,22 @@ static int __devexit omapflash_remove(struct device *dev) | |||
155 | return 0; | 153 | return 0; |
156 | } | 154 | } |
157 | 155 | ||
158 | static struct device_driver omapflash_driver = { | 156 | static struct platform_driver omapflash_driver = { |
159 | .name = "omapflash", | ||
160 | .bus = &platform_bus_type, | ||
161 | .probe = omapflash_probe, | 157 | .probe = omapflash_probe, |
162 | .remove = __devexit_p(omapflash_remove), | 158 | .remove = __devexit_p(omapflash_remove), |
159 | .driver = { | ||
160 | .name = "omapflash", | ||
161 | }, | ||
163 | }; | 162 | }; |
164 | 163 | ||
165 | static int __init omapflash_init(void) | 164 | static int __init omapflash_init(void) |
166 | { | 165 | { |
167 | return driver_register(&omapflash_driver); | 166 | return platform_driver_register(&omapflash_driver); |
168 | } | 167 | } |
169 | 168 | ||
170 | static void __exit omapflash_exit(void) | 169 | static void __exit omapflash_exit(void) |
171 | { | 170 | { |
172 | driver_unregister(&omapflash_driver); | 171 | platform_driver_unregister(&omapflash_driver); |
173 | } | 172 | } |
174 | 173 | ||
175 | module_init(omapflash_init); | 174 | module_init(omapflash_init); |