Commit 7c301306 authored by Andy Shevchenko's avatar Andy Shevchenko Committed by Bartosz Golaszewski

gpio: pca953x: Switch to DEFINE_SIMPLE_DEV_PM_OPS()

SIMPLE_DEV_PM_OPS() is deprecated, replace it with pm_sleep_ptr()
and DEFINE_SIMPLE_DEV_PM_OPS() for setting the driver's PM routines.
We can now remove the ifdeffery surrounding the suspend and resume
functions.
Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: default avatarBartosz Golaszewski <bartosz.golaszewski@linaro.org>
parent 9da0a75e
...@@ -1164,7 +1164,6 @@ static int pca953x_probe(struct i2c_client *client) ...@@ -1164,7 +1164,6 @@ static int pca953x_probe(struct i2c_client *client)
return devm_gpiochip_add_data(dev, &chip->gpio_chip, chip); return devm_gpiochip_add_data(dev, &chip->gpio_chip, chip);
} }
#ifdef CONFIG_PM_SLEEP
static int pca953x_regcache_sync(struct pca953x_chip *chip) static int pca953x_regcache_sync(struct pca953x_chip *chip)
{ {
struct device *dev = &chip->client->dev; struct device *dev = &chip->client->dev;
...@@ -1270,7 +1269,8 @@ static int pca953x_resume(struct device *dev) ...@@ -1270,7 +1269,8 @@ static int pca953x_resume(struct device *dev)
return 0; return 0;
} }
#endif
static DEFINE_SIMPLE_DEV_PM_OPS(pca953x_pm_ops, pca953x_suspend, pca953x_resume);
/* convenience to stop overlong match-table lines */ /* convenience to stop overlong match-table lines */
#define OF_653X(__nrgpio, __int) ((void *)(__nrgpio | PCAL653X_TYPE | __int)) #define OF_653X(__nrgpio, __int) ((void *)(__nrgpio | PCAL653X_TYPE | __int))
...@@ -1328,12 +1328,10 @@ static const struct of_device_id pca953x_dt_ids[] = { ...@@ -1328,12 +1328,10 @@ static const struct of_device_id pca953x_dt_ids[] = {
MODULE_DEVICE_TABLE(of, pca953x_dt_ids); MODULE_DEVICE_TABLE(of, pca953x_dt_ids);
static SIMPLE_DEV_PM_OPS(pca953x_pm_ops, pca953x_suspend, pca953x_resume);
static struct i2c_driver pca953x_driver = { static struct i2c_driver pca953x_driver = {
.driver = { .driver = {
.name = "pca953x", .name = "pca953x",
.pm = &pca953x_pm_ops, .pm = pm_sleep_ptr(&pca953x_pm_ops),
.of_match_table = pca953x_dt_ids, .of_match_table = pca953x_dt_ids,
.acpi_match_table = pca953x_acpi_ids, .acpi_match_table = pca953x_acpi_ids,
}, },
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment