aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/i2c/chips/pcf8591.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/i2c/chips/pcf8591.c')
-rw-r--r--drivers/i2c/chips/pcf8591.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/i2c/chips/pcf8591.c b/drivers/i2c/chips/pcf8591.c
index 80f1df9a4500..ce420a67560b 100644
--- a/drivers/i2c/chips/pcf8591.c
+++ b/drivers/i2c/chips/pcf8591.c
@@ -166,7 +166,7 @@ static int pcf8591_attach_adapter(struct i2c_adapter *adapter)
166} 166}
167 167
168/* This function is called by i2c_probe */ 168/* This function is called by i2c_probe */
169int pcf8591_detect(struct i2c_adapter *adapter, int address, int kind) 169static int pcf8591_detect(struct i2c_adapter *adapter, int address, int kind)
170{ 170{
171 struct i2c_client *new_client; 171 struct i2c_client *new_client;
172 struct pcf8591_data *data; 172 struct pcf8591_data *data;
@@ -178,11 +178,10 @@ int pcf8591_detect(struct i2c_adapter *adapter, int address, int kind)
178 178
179 /* OK. For now, we presume we have a valid client. We now create the 179 /* OK. For now, we presume we have a valid client. We now create the
180 client structure, even though we cannot fill it completely yet. */ 180 client structure, even though we cannot fill it completely yet. */
181 if (!(data = kmalloc(sizeof(struct pcf8591_data), GFP_KERNEL))) { 181 if (!(data = kzalloc(sizeof(struct pcf8591_data), GFP_KERNEL))) {
182 err = -ENOMEM; 182 err = -ENOMEM;
183 goto exit; 183 goto exit;
184 } 184 }
185 memset(data, 0, sizeof(struct pcf8591_data));
186 185
187 new_client = &data->client; 186 new_client = &data->client;
188 i2c_set_clientdata(new_client, data); 187 i2c_set_clientdata(new_client, data);