diff options
Diffstat (limited to 'drivers/i2c/busses/i2c-ixp4xx.c')
-rw-r--r-- | drivers/i2c/busses/i2c-ixp4xx.c | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/drivers/i2c/busses/i2c-ixp4xx.c b/drivers/i2c/busses/i2c-ixp4xx.c index cc652c350814..aa36855fa995 100644 --- a/drivers/i2c/busses/i2c-ixp4xx.c +++ b/drivers/i2c/busses/i2c-ixp4xx.c | |||
@@ -87,12 +87,11 @@ struct ixp4xx_i2c_data { | |||
87 | struct i2c_algo_bit_data algo_data; | 87 | struct i2c_algo_bit_data algo_data; |
88 | }; | 88 | }; |
89 | 89 | ||
90 | static int ixp4xx_i2c_remove(struct device *dev) | 90 | static int ixp4xx_i2c_remove(struct platform_device *plat_dev) |
91 | { | 91 | { |
92 | struct platform_device *plat_dev = to_platform_device(dev); | 92 | struct ixp4xx_i2c_data *drv_data = platform_get_drvdata(plat_dev); |
93 | struct ixp4xx_i2c_data *drv_data = dev_get_drvdata(&plat_dev->dev); | ||
94 | 93 | ||
95 | dev_set_drvdata(&plat_dev->dev, NULL); | 94 | platform_set_drvdata(plat_dev, NULL); |
96 | 95 | ||
97 | i2c_bit_del_bus(&drv_data->adapter); | 96 | i2c_bit_del_bus(&drv_data->adapter); |
98 | 97 | ||
@@ -101,10 +100,9 @@ static int ixp4xx_i2c_remove(struct device *dev) | |||
101 | return 0; | 100 | return 0; |
102 | } | 101 | } |
103 | 102 | ||
104 | static int ixp4xx_i2c_probe(struct device *dev) | 103 | static int ixp4xx_i2c_probe(struct platform_device *plat_dev) |
105 | { | 104 | { |
106 | int err; | 105 | int err; |
107 | struct platform_device *plat_dev = to_platform_device(dev); | ||
108 | struct ixp4xx_i2c_pins *gpio = plat_dev->dev.platform_data; | 106 | struct ixp4xx_i2c_pins *gpio = plat_dev->dev.platform_data; |
109 | struct ixp4xx_i2c_data *drv_data = | 107 | struct ixp4xx_i2c_data *drv_data = |
110 | kzalloc(sizeof(struct ixp4xx_i2c_data), GFP_KERNEL); | 108 | kzalloc(sizeof(struct ixp4xx_i2c_data), GFP_KERNEL); |
@@ -148,27 +146,28 @@ static int ixp4xx_i2c_probe(struct device *dev) | |||
148 | return err; | 146 | return err; |
149 | } | 147 | } |
150 | 148 | ||
151 | dev_set_drvdata(&plat_dev->dev, drv_data); | 149 | platform_set_drvdata(plat_dev, drv_data); |
152 | 150 | ||
153 | return 0; | 151 | return 0; |
154 | } | 152 | } |
155 | 153 | ||
156 | static struct device_driver ixp4xx_i2c_driver = { | 154 | static struct platform_driver ixp4xx_i2c_driver = { |
157 | .owner = THIS_MODULE, | ||
158 | .name = "IXP4XX-I2C", | ||
159 | .bus = &platform_bus_type, | ||
160 | .probe = ixp4xx_i2c_probe, | 155 | .probe = ixp4xx_i2c_probe, |
161 | .remove = ixp4xx_i2c_remove, | 156 | .remove = ixp4xx_i2c_remove, |
157 | .driver = { | ||
158 | .name = "IXP4XX-I2C", | ||
159 | .owner = THIS_MODULE, | ||
160 | }, | ||
162 | }; | 161 | }; |
163 | 162 | ||
164 | static int __init ixp4xx_i2c_init(void) | 163 | static int __init ixp4xx_i2c_init(void) |
165 | { | 164 | { |
166 | return driver_register(&ixp4xx_i2c_driver); | 165 | return platform_driver_register(&ixp4xx_i2c_driver); |
167 | } | 166 | } |
168 | 167 | ||
169 | static void __exit ixp4xx_i2c_exit(void) | 168 | static void __exit ixp4xx_i2c_exit(void) |
170 | { | 169 | { |
171 | driver_unregister(&ixp4xx_i2c_driver); | 170 | platform_driver_unregister(&ixp4xx_i2c_driver); |
172 | } | 171 | } |
173 | 172 | ||
174 | module_init(ixp4xx_i2c_init); | 173 | module_init(ixp4xx_i2c_init); |