Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>

authored by

Andy Shevchenko and committed by
Bartosz Golaszewski
7c301306 9da0a75e

+3 -5
+3 -5
drivers/gpio/gpio-pca953x.c
··· 1164 1164 return devm_gpiochip_add_data(dev, &chip->gpio_chip, chip); 1165 1165 } 1166 1166 1167 - #ifdef CONFIG_PM_SLEEP 1168 1167 static int pca953x_regcache_sync(struct pca953x_chip *chip) 1169 1168 { 1170 1169 struct device *dev = &chip->client->dev; ··· 1269 1270 1270 1271 return 0; 1271 1272 } 1272 - #endif 1273 + 1274 + static DEFINE_SIMPLE_DEV_PM_OPS(pca953x_pm_ops, pca953x_suspend, pca953x_resume); 1273 1275 1274 1276 /* convenience to stop overlong match-table lines */ 1275 1277 #define OF_653X(__nrgpio, __int) ((void *)(__nrgpio | PCAL653X_TYPE | __int)) ··· 1328 1328 1329 1329 MODULE_DEVICE_TABLE(of, pca953x_dt_ids); 1330 1330 1331 - static SIMPLE_DEV_PM_OPS(pca953x_pm_ops, pca953x_suspend, pca953x_resume); 1332 - 1333 1331 static struct i2c_driver pca953x_driver = { 1334 1332 .driver = { 1335 1333 .name = "pca953x", 1336 - .pm = &pca953x_pm_ops, 1334 + .pm = pm_sleep_ptr(&pca953x_pm_ops), 1337 1335 .of_match_table = pca953x_dt_ids, 1338 1336 .acpi_match_table = pca953x_acpi_ids, 1339 1337 },