diff options
Diffstat (limited to 'drivers/i2c/busses/i2c-ixp4xx.c')
-rw-r--r-- | drivers/i2c/busses/i2c-ixp4xx.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/i2c/busses/i2c-ixp4xx.c b/drivers/i2c/busses/i2c-ixp4xx.c index f6f5ca31fdba..69303ab65e04 100644 --- a/drivers/i2c/busses/i2c-ixp4xx.c +++ b/drivers/i2c/busses/i2c-ixp4xx.c | |||
@@ -35,6 +35,8 @@ | |||
35 | 35 | ||
36 | #include <asm/hardware.h> /* Pick up IXP4xx-specific bits */ | 36 | #include <asm/hardware.h> /* Pick up IXP4xx-specific bits */ |
37 | 37 | ||
38 | static struct device_driver ixp4xx_i2c_driver; | ||
39 | |||
38 | static inline int ixp4xx_scl_pin(void *data) | 40 | static inline int ixp4xx_scl_pin(void *data) |
39 | { | 41 | { |
40 | return ((struct ixp4xx_i2c_pins*)data)->scl_pin; | 42 | return ((struct ixp4xx_i2c_pins*)data)->scl_pin; |
@@ -105,12 +107,11 @@ static int ixp4xx_i2c_probe(struct device *dev) | |||
105 | struct platform_device *plat_dev = to_platform_device(dev); | 107 | struct platform_device *plat_dev = to_platform_device(dev); |
106 | struct ixp4xx_i2c_pins *gpio = plat_dev->dev.platform_data; | 108 | struct ixp4xx_i2c_pins *gpio = plat_dev->dev.platform_data; |
107 | struct ixp4xx_i2c_data *drv_data = | 109 | struct ixp4xx_i2c_data *drv_data = |
108 | kmalloc(sizeof(struct ixp4xx_i2c_data), GFP_KERNEL); | 110 | kzalloc(sizeof(struct ixp4xx_i2c_data), GFP_KERNEL); |
109 | 111 | ||
110 | if(!drv_data) | 112 | if(!drv_data) |
111 | return -ENOMEM; | 113 | return -ENOMEM; |
112 | 114 | ||
113 | memzero(drv_data, sizeof(struct ixp4xx_i2c_data)); | ||
114 | drv_data->gpio_pins = gpio; | 115 | drv_data->gpio_pins = gpio; |
115 | 116 | ||
116 | /* | 117 | /* |
@@ -129,6 +130,8 @@ static int ixp4xx_i2c_probe(struct device *dev) | |||
129 | drv_data->algo_data.timeout = 100; | 130 | drv_data->algo_data.timeout = 100; |
130 | 131 | ||
131 | drv_data->adapter.id = I2C_HW_B_IXP4XX; | 132 | drv_data->adapter.id = I2C_HW_B_IXP4XX; |
133 | strlcpy(drv_data->adapter.name, ixp4xx_i2c_driver.name, | ||
134 | I2C_NAME_SIZE); | ||
132 | drv_data->adapter.algo_data = &drv_data->algo_data; | 135 | drv_data->adapter.algo_data = &drv_data->algo_data; |
133 | 136 | ||
134 | drv_data->adapter.dev.parent = &plat_dev->dev; | 137 | drv_data->adapter.dev.parent = &plat_dev->dev; |
@@ -151,6 +154,7 @@ static int ixp4xx_i2c_probe(struct device *dev) | |||
151 | } | 154 | } |
152 | 155 | ||
153 | static struct device_driver ixp4xx_i2c_driver = { | 156 | static struct device_driver ixp4xx_i2c_driver = { |
157 | .owner = THIS_MODULE, | ||
154 | .name = "IXP4XX-I2C", | 158 | .name = "IXP4XX-I2C", |
155 | .bus = &platform_bus_type, | 159 | .bus = &platform_bus_type, |
156 | .probe = ixp4xx_i2c_probe, | 160 | .probe = ixp4xx_i2c_probe, |