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/i2c/busses/i2c-mv64xxx.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/i2c/busses/i2c-mv64xxx.c')
-rw-r--r-- | drivers/i2c/busses/i2c-mv64xxx.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/drivers/i2c/busses/i2c-mv64xxx.c b/drivers/i2c/busses/i2c-mv64xxx.c index 6b48027b2ee3..afd7634e5cc9 100644 --- a/drivers/i2c/busses/i2c-mv64xxx.c +++ b/drivers/i2c/busses/i2c-mv64xxx.c | |||
@@ -492,11 +492,10 @@ mv64xxx_i2c_unmap_regs(struct mv64xxx_i2c_data *drv_data) | |||
492 | } | 492 | } |
493 | 493 | ||
494 | static int __devinit | 494 | static int __devinit |
495 | mv64xxx_i2c_probe(struct device *dev) | 495 | mv64xxx_i2c_probe(struct platform_device *pd) |
496 | { | 496 | { |
497 | struct platform_device *pd = to_platform_device(dev); | ||
498 | struct mv64xxx_i2c_data *drv_data; | 497 | struct mv64xxx_i2c_data *drv_data; |
499 | struct mv64xxx_i2c_pdata *pdata = dev->platform_data; | 498 | struct mv64xxx_i2c_pdata *pdata = pd->dev.platform_data; |
500 | int rc; | 499 | int rc; |
501 | 500 | ||
502 | if ((pd->id != 0) || !pdata) | 501 | if ((pd->id != 0) || !pdata) |
@@ -526,7 +525,7 @@ mv64xxx_i2c_probe(struct device *dev) | |||
526 | drv_data->adapter.class = I2C_CLASS_HWMON; | 525 | drv_data->adapter.class = I2C_CLASS_HWMON; |
527 | drv_data->adapter.timeout = pdata->timeout; | 526 | drv_data->adapter.timeout = pdata->timeout; |
528 | drv_data->adapter.retries = pdata->retries; | 527 | drv_data->adapter.retries = pdata->retries; |
529 | dev_set_drvdata(dev, drv_data); | 528 | platform_set_drvdata(pd, drv_data); |
530 | i2c_set_adapdata(&drv_data->adapter, drv_data); | 529 | i2c_set_adapdata(&drv_data->adapter, drv_data); |
531 | 530 | ||
532 | if (request_irq(drv_data->irq, mv64xxx_i2c_intr, 0, | 531 | if (request_irq(drv_data->irq, mv64xxx_i2c_intr, 0, |
@@ -555,9 +554,9 @@ mv64xxx_i2c_probe(struct device *dev) | |||
555 | } | 554 | } |
556 | 555 | ||
557 | static int __devexit | 556 | static int __devexit |
558 | mv64xxx_i2c_remove(struct device *dev) | 557 | mv64xxx_i2c_remove(struct platform_device *dev) |
559 | { | 558 | { |
560 | struct mv64xxx_i2c_data *drv_data = dev_get_drvdata(dev); | 559 | struct mv64xxx_i2c_data *drv_data = platform_get_drvdata(dev); |
561 | int rc; | 560 | int rc; |
562 | 561 | ||
563 | rc = i2c_del_adapter(&drv_data->adapter); | 562 | rc = i2c_del_adapter(&drv_data->adapter); |
@@ -568,24 +567,25 @@ mv64xxx_i2c_remove(struct device *dev) | |||
568 | return rc; | 567 | return rc; |
569 | } | 568 | } |
570 | 569 | ||
571 | static struct device_driver mv64xxx_i2c_driver = { | 570 | static struct platform_driver mv64xxx_i2c_driver = { |
572 | .owner = THIS_MODULE, | ||
573 | .name = MV64XXX_I2C_CTLR_NAME, | ||
574 | .bus = &platform_bus_type, | ||
575 | .probe = mv64xxx_i2c_probe, | 571 | .probe = mv64xxx_i2c_probe, |
576 | .remove = mv64xxx_i2c_remove, | 572 | .remove = mv64xxx_i2c_remove, |
573 | .driver = { | ||
574 | .owner = THIS_MODULE, | ||
575 | .name = MV64XXX_I2C_CTLR_NAME, | ||
576 | }, | ||
577 | }; | 577 | }; |
578 | 578 | ||
579 | static int __init | 579 | static int __init |
580 | mv64xxx_i2c_init(void) | 580 | mv64xxx_i2c_init(void) |
581 | { | 581 | { |
582 | return driver_register(&mv64xxx_i2c_driver); | 582 | return platform_driver_register(&mv64xxx_i2c_driver); |
583 | } | 583 | } |
584 | 584 | ||
585 | static void __exit | 585 | static void __exit |
586 | mv64xxx_i2c_exit(void) | 586 | mv64xxx_i2c_exit(void) |
587 | { | 587 | { |
588 | driver_unregister(&mv64xxx_i2c_driver); | 588 | platform_driver_unregister(&mv64xxx_i2c_driver); |
589 | } | 589 | } |
590 | 590 | ||
591 | module_init(mv64xxx_i2c_init); | 591 | module_init(mv64xxx_i2c_init); |