Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 312635
b: refs/heads/master
c: 8a8e3d5
h: refs/heads/master
i:
  312633: b8a5bf1
  312631: ae07369
v: v3
  • Loading branch information
Laxman Dewangan authored and Mark Brown committed Jul 15, 2012
1 parent 6dbf565 commit 79b3a30
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 23 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d5b2e30bdc695a1735b3c970e1f9738e9ca3dbf0
refs/heads/master: 8a8e3d5915b3b40a64a5e7dc5aeb208594917a15
28 changes: 6 additions & 22 deletions trunk/drivers/regulator/tps62360-regulator.c
Original file line number Diff line number Diff line change
Expand Up @@ -428,24 +428,24 @@ static int __devinit tps62360_probe(struct i2c_client *client,
int gpio_flags;
gpio_flags = (pdata->vsel0_def_state) ?
GPIOF_OUT_INIT_HIGH : GPIOF_OUT_INIT_LOW;
ret = gpio_request_one(tps->vsel0_gpio,
ret = devm_gpio_request_one(&client->dev, tps->vsel0_gpio,
gpio_flags, "tps62360-vsel0");
if (ret) {
dev_err(&client->dev,
"%s(): Could not obtain vsel0 GPIO %d: %d\n",
__func__, tps->vsel0_gpio, ret);
goto err_gpio0;
return ret;
}

gpio_flags = (pdata->vsel1_def_state) ?
GPIOF_OUT_INIT_HIGH : GPIOF_OUT_INIT_LOW;
ret = gpio_request_one(tps->vsel1_gpio,
ret = devm_gpio_request_one(&client->dev, tps->vsel1_gpio,
gpio_flags, "tps62360-vsel1");
if (ret) {
dev_err(&client->dev,
"%s(): Could not obtain vsel1 GPIO %d: %d\n",
__func__, tps->vsel1_gpio, ret);
goto err_gpio1;
return ret;
}
tps->valid_gpios = true;

Expand All @@ -463,7 +463,7 @@ static int __devinit tps62360_probe(struct i2c_client *client,
if (ret < 0) {
dev_err(tps->dev, "%s(): Init failed with err = %d\n",
__func__, ret);
goto err_init;
return ret;
}

config.dev = &client->dev;
Expand All @@ -477,21 +477,11 @@ static int __devinit tps62360_probe(struct i2c_client *client,
dev_err(tps->dev,
"%s(): regulator register failed with err %s\n",
__func__, id->name);
ret = PTR_ERR(rdev);
goto err_init;
return PTR_ERR(rdev);
}

tps->rdev = rdev;
return 0;

err_init:
if (gpio_is_valid(tps->vsel1_gpio))
gpio_free(tps->vsel1_gpio);
err_gpio1:
if (gpio_is_valid(tps->vsel0_gpio))
gpio_free(tps->vsel0_gpio);
err_gpio0:
return ret;
}

/**
Expand All @@ -504,12 +494,6 @@ static int __devexit tps62360_remove(struct i2c_client *client)
{
struct tps62360_chip *tps = i2c_get_clientdata(client);

if (gpio_is_valid(tps->vsel1_gpio))
gpio_free(tps->vsel1_gpio);

if (gpio_is_valid(tps->vsel0_gpio))
gpio_free(tps->vsel0_gpio);

regulator_unregister(tps->rdev);
return 0;
}
Expand Down

0 comments on commit 79b3a30

Please sign in to comment.