diff options
author | Linus Torvalds <torvalds@g5.osdl.org> | 2005-11-11 09:24:26 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-11-11 09:24:26 -0800 |
commit | 5643f000c1e10ab991182478b76550e1364c3570 (patch) | |
tree | 950b2f61a5dd742de1c668ba968a9c8a99f1eab6 /drivers/i2c/busses/i2c-ixp2000.c | |
parent | 177294d19174cf92de22434bb1fc9a8ecdbbe658 (diff) | |
parent | 3ae5eaec1d2d9c0cf53745352e7d4b152810ba24 (diff) |
Merge master.kernel.org:/home/rmk/linux-2.6-drvmodel
Diffstat (limited to 'drivers/i2c/busses/i2c-ixp2000.c')
-rw-r--r-- | drivers/i2c/busses/i2c-ixp2000.c | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/drivers/i2c/busses/i2c-ixp2000.c b/drivers/i2c/busses/i2c-ixp2000.c index 64552a376f2..cef024a7d04 100644 --- a/drivers/i2c/busses/i2c-ixp2000.c +++ b/drivers/i2c/busses/i2c-ixp2000.c @@ -86,12 +86,11 @@ struct ixp2000_i2c_data { struct i2c_algo_bit_data algo_data; }; -static int ixp2000_i2c_remove(struct device *dev) +static int ixp2000_i2c_remove(struct platform_device *plat_dev) { - struct platform_device *plat_dev = to_platform_device(dev); - struct ixp2000_i2c_data *drv_data = dev_get_drvdata(&plat_dev->dev); + struct ixp2000_i2c_data *drv_data = platform_get_drvdata(plat_dev); - dev_set_drvdata(&plat_dev->dev, NULL); + platform_set_drvdata(plat_dev, NULL); i2c_bit_del_bus(&drv_data->adapter); @@ -100,10 +99,9 @@ static int ixp2000_i2c_remove(struct device *dev) return 0; } -static int ixp2000_i2c_probe(struct device *dev) +static int ixp2000_i2c_probe(struct platform_device *plat_dev) { int err; - struct platform_device *plat_dev = to_platform_device(dev); struct ixp2000_i2c_pins *gpio = plat_dev->dev.platform_data; struct ixp2000_i2c_data *drv_data = kzalloc(sizeof(struct ixp2000_i2c_data), GFP_KERNEL); @@ -139,27 +137,28 @@ static int ixp2000_i2c_probe(struct device *dev) return err; } - dev_set_drvdata(&plat_dev->dev, drv_data); + platform_set_drvdata(plat_dev, drv_data); return 0; } -static struct device_driver ixp2000_i2c_driver = { - .owner = THIS_MODULE, - .name = "IXP2000-I2C", - .bus = &platform_bus_type, +static struct platform_driver ixp2000_i2c_driver = { .probe = ixp2000_i2c_probe, .remove = ixp2000_i2c_remove, + .driver = { + .name = "IXP2000-I2C", + .owner = THIS_MODULE, + }, }; static int __init ixp2000_i2c_init(void) { - return driver_register(&ixp2000_i2c_driver); + return platform_driver_register(&ixp2000_i2c_driver); } static void __exit ixp2000_i2c_exit(void) { - driver_unregister(&ixp2000_i2c_driver); + platform_driver_unregister(&ixp2000_i2c_driver); } module_init(ixp2000_i2c_init); |