aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/misc/usb3503.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/misc/usb3503.c')
-rw-r--r--drivers/usb/misc/usb3503.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/usb/misc/usb3503.c b/drivers/usb/misc/usb3503.c
index c3770734da42..dc2c993ea189 100644
--- a/drivers/usb/misc/usb3503.c
+++ b/drivers/usb/misc/usb3503.c
@@ -182,12 +182,12 @@ static int usb3503_probe(struct i2c_client *i2c, const struct i2c_device_id *id)
182{ 182{
183 struct usb3503_platform_data *pdata = i2c->dev.platform_data; 183 struct usb3503_platform_data *pdata = i2c->dev.platform_data;
184 struct usb3503 *hub; 184 struct usb3503 *hub;
185 int err; 185 int err = -ENOMEM;
186 186
187 hub = kzalloc(sizeof(struct usb3503), GFP_KERNEL); 187 hub = kzalloc(sizeof(struct usb3503), GFP_KERNEL);
188 if (!hub) { 188 if (!hub) {
189 dev_err(&i2c->dev, "private data alloc fail\n"); 189 dev_err(&i2c->dev, "private data alloc fail\n");
190 return -ENOMEM; 190 return err;
191 } 191 }
192 192
193 i2c_set_clientdata(i2c, hub); 193 i2c_set_clientdata(i2c, hub);
@@ -195,6 +195,7 @@ static int usb3503_probe(struct i2c_client *i2c, const struct i2c_device_id *id)
195 195
196 if (!pdata) { 196 if (!pdata) {
197 dev_dbg(&i2c->dev, "missing platform data\n"); 197 dev_dbg(&i2c->dev, "missing platform data\n");
198 goto err_out;
198 } else { 199 } else {
199 hub->gpio_intn = pdata->gpio_intn; 200 hub->gpio_intn = pdata->gpio_intn;
200 hub->gpio_connect = pdata->gpio_connect; 201 hub->gpio_connect = pdata->gpio_connect;
@@ -209,7 +210,7 @@ static int usb3503_probe(struct i2c_client *i2c, const struct i2c_device_id *id)
209 dev_err(&i2c->dev, 210 dev_err(&i2c->dev,
210 "unable to request GPIO %d as connect pin (%d)\n", 211 "unable to request GPIO %d as connect pin (%d)\n",
211 hub->gpio_intn, err); 212 hub->gpio_intn, err);
212 goto err_gpio_intn; 213 goto err_out;
213 } 214 }
214 } 215 }
215 216
@@ -248,7 +249,7 @@ err_gpio_reset:
248err_gpio_connect: 249err_gpio_connect:
249 if (gpio_is_valid(hub->gpio_intn)) 250 if (gpio_is_valid(hub->gpio_intn))
250 gpio_free(hub->gpio_intn); 251 gpio_free(hub->gpio_intn);
251err_gpio_intn: 252err_out:
252 kfree(hub); 253 kfree(hub);
253 254
254 return err; 255 return err;