[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230901134041.1165562-8-andriy.shevchenko@linux.intel.com>
Date: Fri, 1 Sep 2023 16:40:39 +0300
From: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
linux-gpio@...r.kernel.org, linux-kernel@...r.kernel.org
Cc: Linus Walleij <linus.walleij@...aro.org>,
Bartosz Golaszewski <brgl@...ev.pl>,
Andy Shevchenko <andy@...nel.org>
Subject: [PATCH v1 08/10] 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@...ux.intel.com>
---
drivers/gpio/gpio-pca953x.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/drivers/gpio/gpio-pca953x.c b/drivers/gpio/gpio-pca953x.c
index fe113c74b7b2..bf27e2d920f7 100644
--- a/drivers/gpio/gpio-pca953x.c
+++ b/drivers/gpio/gpio-pca953x.c
@@ -1164,7 +1164,6 @@ static int pca953x_probe(struct i2c_client *client)
return devm_gpiochip_add_data(dev, &chip->gpio_chip, chip);
}
-#ifdef CONFIG_PM_SLEEP
static int pca953x_regcache_sync(struct pca953x_chip *chip)
{
struct device *dev = &chip->client->dev;
@@ -1270,7 +1269,8 @@ static int pca953x_resume(struct device *dev)
return 0;
}
-#endif
+
+static DEFINE_SIMPLE_DEV_PM_OPS(pca953x_pm_ops, pca953x_suspend, pca953x_resume);
/* convenience to stop overlong match-table lines */
#define OF_653X(__nrgpio, __int) ((void *)(__nrgpio | PCAL653X_TYPE | __int))
@@ -1328,12 +1328,10 @@ static const struct of_device_id 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 = {
.driver = {
.name = "pca953x",
- .pm = &pca953x_pm_ops,
+ .pm = pm_sleep_ptr(&pca953x_pm_ops),
.of_match_table = pca953x_dt_ids,
.acpi_match_table = pca953x_acpi_ids,
},
--
2.40.0.1.gaa8946217a0b
Powered by blists - more mailing lists