diff options
author | Russell King <rmk@dyn-67.arm.linux.org.uk> | 2005-11-09 17:32:44 -0500 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2005-11-09 17:32:44 -0500 |
commit | 3ae5eaec1d2d9c0cf53745352e7d4b152810ba24 (patch) | |
tree | d8825be54cefb6ad6707478d719c8e30605bee7b /drivers/mfd/mcp-sa11x0.c | |
parent | 00d3dcdd96646be6059cc21f2efa94c4edc1eda5 (diff) |
[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 <rmk+kernel@arm.linux.org.uk>
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/mfd/mcp-sa11x0.c')
-rw-r--r-- | drivers/mfd/mcp-sa11x0.c | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/drivers/mfd/mcp-sa11x0.c b/drivers/mfd/mcp-sa11x0.c index 7daa0ed7331c..1eab7cffceaa 100644 --- a/drivers/mfd/mcp-sa11x0.c +++ b/drivers/mfd/mcp-sa11x0.c | |||
@@ -138,9 +138,8 @@ static struct mcp_ops mcp_sa11x0 = { | |||
138 | .disable = mcp_sa11x0_disable, | 138 | .disable = mcp_sa11x0_disable, |
139 | }; | 139 | }; |
140 | 140 | ||
141 | static int mcp_sa11x0_probe(struct device *dev) | 141 | static int mcp_sa11x0_probe(struct platform_device *pdev) |
142 | { | 142 | { |
143 | struct platform_device *pdev = to_platform_device(dev); | ||
144 | struct mcp_plat_data *data = pdev->dev.platform_data; | 143 | struct mcp_plat_data *data = pdev->dev.platform_data; |
145 | struct mcp *mcp; | 144 | struct mcp *mcp; |
146 | int ret; | 145 | int ret; |
@@ -165,7 +164,7 @@ static int mcp_sa11x0_probe(struct device *dev) | |||
165 | mcp->dma_telco_rd = DMA_Ser4MCP1Rd; | 164 | mcp->dma_telco_rd = DMA_Ser4MCP1Rd; |
166 | mcp->dma_telco_wr = DMA_Ser4MCP1Wr; | 165 | mcp->dma_telco_wr = DMA_Ser4MCP1Wr; |
167 | 166 | ||
168 | dev_set_drvdata(dev, mcp); | 167 | platform_set_drvdata(pdev, mcp); |
169 | 168 | ||
170 | if (machine_is_assabet()) { | 169 | if (machine_is_assabet()) { |
171 | ASSABET_BCR_set(ASSABET_BCR_CODEC_RST); | 170 | ASSABET_BCR_set(ASSABET_BCR_CODEC_RST); |
@@ -202,26 +201,26 @@ static int mcp_sa11x0_probe(struct device *dev) | |||
202 | 201 | ||
203 | release: | 202 | release: |
204 | release_mem_region(0x80060000, 0x60); | 203 | release_mem_region(0x80060000, 0x60); |
205 | dev_set_drvdata(dev, NULL); | 204 | platform_set_drvdata(pdev, NULL); |
206 | 205 | ||
207 | out: | 206 | out: |
208 | return ret; | 207 | return ret; |
209 | } | 208 | } |
210 | 209 | ||
211 | static int mcp_sa11x0_remove(struct device *dev) | 210 | static int mcp_sa11x0_remove(struct platform_device *dev) |
212 | { | 211 | { |
213 | struct mcp *mcp = dev_get_drvdata(dev); | 212 | struct mcp *mcp = platform_get_drvdata(dev); |
214 | 213 | ||
215 | dev_set_drvdata(dev, NULL); | 214 | platform_set_drvdata(dev, NULL); |
216 | mcp_host_unregister(mcp); | 215 | mcp_host_unregister(mcp); |
217 | release_mem_region(0x80060000, 0x60); | 216 | release_mem_region(0x80060000, 0x60); |
218 | 217 | ||
219 | return 0; | 218 | return 0; |
220 | } | 219 | } |
221 | 220 | ||
222 | static int mcp_sa11x0_suspend(struct device *dev, pm_message_t state) | 221 | static int mcp_sa11x0_suspend(struct platform_device *dev, pm_message_t state) |
223 | { | 222 | { |
224 | struct mcp *mcp = dev_get_drvdata(dev); | 223 | struct mcp *mcp = platform_get_drvdata(dev); |
225 | 224 | ||
226 | priv(mcp)->mccr0 = Ser4MCCR0; | 225 | priv(mcp)->mccr0 = Ser4MCCR0; |
227 | priv(mcp)->mccr1 = Ser4MCCR1; | 226 | priv(mcp)->mccr1 = Ser4MCCR1; |
@@ -230,9 +229,9 @@ static int mcp_sa11x0_suspend(struct device *dev, pm_message_t state) | |||
230 | return 0; | 229 | return 0; |
231 | } | 230 | } |
232 | 231 | ||
233 | static int mcp_sa11x0_resume(struct device *dev) | 232 | static int mcp_sa11x0_resume(struct platform_device *dev) |
234 | { | 233 | { |
235 | struct mcp *mcp = dev_get_drvdata(dev); | 234 | struct mcp *mcp = platform_get_drvdata(dev); |
236 | 235 | ||
237 | Ser4MCCR1 = priv(mcp)->mccr1; | 236 | Ser4MCCR1 = priv(mcp)->mccr1; |
238 | Ser4MCCR0 = priv(mcp)->mccr0; | 237 | Ser4MCCR0 = priv(mcp)->mccr0; |
@@ -243,13 +242,14 @@ static int mcp_sa11x0_resume(struct device *dev) | |||
243 | /* | 242 | /* |
244 | * The driver for the SA11x0 MCP port. | 243 | * The driver for the SA11x0 MCP port. |
245 | */ | 244 | */ |
246 | static struct device_driver mcp_sa11x0_driver = { | 245 | static struct platform_driver mcp_sa11x0_driver = { |
247 | .name = "sa11x0-mcp", | ||
248 | .bus = &platform_bus_type, | ||
249 | .probe = mcp_sa11x0_probe, | 246 | .probe = mcp_sa11x0_probe, |
250 | .remove = mcp_sa11x0_remove, | 247 | .remove = mcp_sa11x0_remove, |
251 | .suspend = mcp_sa11x0_suspend, | 248 | .suspend = mcp_sa11x0_suspend, |
252 | .resume = mcp_sa11x0_resume, | 249 | .resume = mcp_sa11x0_resume, |
250 | .driver = { | ||
251 | .name = "sa11x0-mcp", | ||
252 | }, | ||
253 | }; | 253 | }; |
254 | 254 | ||
255 | /* | 255 | /* |
@@ -257,12 +257,12 @@ static struct device_driver mcp_sa11x0_driver = { | |||
257 | */ | 257 | */ |
258 | static int __init mcp_sa11x0_init(void) | 258 | static int __init mcp_sa11x0_init(void) |
259 | { | 259 | { |
260 | return driver_register(&mcp_sa11x0_driver); | 260 | return platform_driver_register(&mcp_sa11x0_driver); |
261 | } | 261 | } |
262 | 262 | ||
263 | static void __exit mcp_sa11x0_exit(void) | 263 | static void __exit mcp_sa11x0_exit(void) |
264 | { | 264 | { |
265 | driver_unregister(&mcp_sa11x0_driver); | 265 | platform_driver_unregister(&mcp_sa11x0_driver); |
266 | } | 266 | } |
267 | 267 | ||
268 | module_init(mcp_sa11x0_init); | 268 | module_init(mcp_sa11x0_init); |