Skip to content

Commit

Permalink
Changed the gpio to user device managed resources
Browse files Browse the repository at this point in the history
  • Loading branch information
Iiro Vuorio committed Oct 23, 2018
1 parent a6be37c commit d7092dc
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions amg88xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -888,7 +888,7 @@ static int amg88xx_probe_new(struct i2c_client *client)
else
device->client = client;

device->int_gpio = gpiod_get(&client->dev, "interrupt", GPIOD_IN);
device->int_gpio = devm_gpiod_get(&client->dev, "interrupt", GPIOD_IN);
if (IS_ERR(device->int_gpio)) {
dev_err(&client->dev, "Failed to get a gpio line for interrupt\n");
return PTR_ERR(device->int_gpio);
Expand Down Expand Up @@ -928,8 +928,6 @@ static int amg88xx_remove(struct i2c_client *client)
int ret;
struct amg88xx *device = dev_get_drvdata(&client->dev);

gpiod_put(device->int_gpio);

ret = amg88xx_set_dev_mode(device, SLEEP_MODE);
if (ret < 0) {
dev_err(&client->dev, "Failed to put the device to sleep\n");
Expand Down

0 comments on commit d7092dc

Please sign in to comment.