aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/i2c/busses/i2c-ixp2000.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/i2c/busses/i2c-ixp2000.c')
-rw-r--r--drivers/i2c/busses/i2c-ixp2000.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/i2c/busses/i2c-ixp2000.c b/drivers/i2c/busses/i2c-ixp2000.c
index 1956af382cd8..42016ee6ef13 100644
--- a/drivers/i2c/busses/i2c-ixp2000.c
+++ b/drivers/i2c/busses/i2c-ixp2000.c
@@ -36,6 +36,8 @@
36#include <asm/hardware.h> /* Pick up IXP2000-specific bits */ 36#include <asm/hardware.h> /* Pick up IXP2000-specific bits */
37#include <asm/arch/gpio.h> 37#include <asm/arch/gpio.h>
38 38
39static struct device_driver ixp2000_i2c_driver;
40
39static inline int ixp2000_scl_pin(void *data) 41static inline int ixp2000_scl_pin(void *data)
40{ 42{
41 return ((struct ixp2000_i2c_pins*)data)->scl_pin; 43 return ((struct ixp2000_i2c_pins*)data)->scl_pin;
@@ -104,11 +106,10 @@ static int ixp2000_i2c_probe(struct device *dev)
104 struct platform_device *plat_dev = to_platform_device(dev); 106 struct platform_device *plat_dev = to_platform_device(dev);
105 struct ixp2000_i2c_pins *gpio = plat_dev->dev.platform_data; 107 struct ixp2000_i2c_pins *gpio = plat_dev->dev.platform_data;
106 struct ixp2000_i2c_data *drv_data = 108 struct ixp2000_i2c_data *drv_data =
107 kmalloc(sizeof(struct ixp2000_i2c_data), GFP_KERNEL); 109 kzalloc(sizeof(struct ixp2000_i2c_data), GFP_KERNEL);
108 110
109 if (!drv_data) 111 if (!drv_data)
110 return -ENOMEM; 112 return -ENOMEM;
111 memzero(drv_data, sizeof(*drv_data));
112 drv_data->gpio_pins = gpio; 113 drv_data->gpio_pins = gpio;
113 114
114 drv_data->algo_data.data = gpio; 115 drv_data->algo_data.data = gpio;
@@ -121,6 +122,8 @@ static int ixp2000_i2c_probe(struct device *dev)
121 drv_data->algo_data.timeout = 100; 122 drv_data->algo_data.timeout = 100;
122 123
123 drv_data->adapter.id = I2C_HW_B_IXP2000, 124 drv_data->adapter.id = I2C_HW_B_IXP2000,
125 strlcpy(drv_data->adapter.name, ixp2000_i2c_driver.name,
126 I2C_NAME_SIZE);
124 drv_data->adapter.algo_data = &drv_data->algo_data, 127 drv_data->adapter.algo_data = &drv_data->algo_data,
125 128
126 drv_data->adapter.dev.parent = &plat_dev->dev; 129 drv_data->adapter.dev.parent = &plat_dev->dev;
@@ -142,6 +145,7 @@ static int ixp2000_i2c_probe(struct device *dev)
142} 145}
143 146
144static struct device_driver ixp2000_i2c_driver = { 147static struct device_driver ixp2000_i2c_driver = {
148 .owner = THIS_MODULE,
145 .name = "IXP2000-I2C", 149 .name = "IXP2000-I2C",
146 .bus = &platform_bus_type, 150 .bus = &platform_bus_type,
147 .probe = ixp2000_i2c_probe, 151 .probe = ixp2000_i2c_probe,