diff options
author | Laxman Dewangan <ldewangan@nvidia.com> | 2016-02-22 15:13:28 +0300 |
---|---|---|
committer | Laxman Dewangan <ldewangan@nvidia.com> | 2016-02-23 18:05:43 +0300 |
commit | c7c8a8fc1eb74cecdee5b7d91feaaa638194eb78 (patch) | |
tree | 7e918deab6626392fad500171c662d81580a325c /drivers | |
parent | 1a20cb2d7da02d13888fb3bd8a5dc7b2a8be3181 (diff) | |
download | linux-c7c8a8fc1eb74cecdee5b7d91feaaa638194eb78.tar.xz |
gpio: sx150x: Use devm_gpiochip_add_data() for gpio registration
Use devm_gpiochip_add_data() for GPIO registration and remove the
need of driver callback .remove.
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/gpio/gpio-sx150x.c | 18 |
1 files changed, 2 insertions, 16 deletions
diff --git a/drivers/gpio/gpio-sx150x.c b/drivers/gpio/gpio-sx150x.c index e6cff1cabd0c..d387eb524bf3 100644 --- a/drivers/gpio/gpio-sx150x.c +++ b/drivers/gpio/gpio-sx150x.c @@ -687,7 +687,7 @@ static int sx150x_probe(struct i2c_client *client, if (rc < 0) return rc; - rc = gpiochip_add_data(&chip->gpio_chip, chip); + rc = devm_gpiochip_add_data(&client->dev, &chip->gpio_chip, chip); if (rc) return rc; @@ -696,25 +696,12 @@ static int sx150x_probe(struct i2c_client *client, pdata->irq_summary, pdata->irq_base); if (rc < 0) - goto probe_fail_post_gpiochip_add; + return rc; } i2c_set_clientdata(client, chip); return 0; -probe_fail_post_gpiochip_add: - gpiochip_remove(&chip->gpio_chip); - return rc; -} - -static int sx150x_remove(struct i2c_client *client) -{ - struct sx150x_chip *chip; - - chip = i2c_get_clientdata(client); - gpiochip_remove(&chip->gpio_chip); - - return 0; } static struct i2c_driver sx150x_driver = { @@ -723,7 +710,6 @@ static struct i2c_driver sx150x_driver = { .of_match_table = of_match_ptr(sx150x_of_match), }, .probe = sx150x_probe, - .remove = sx150x_remove, .id_table = sx150x_id, }; |