Skip to content

Commit ffa5d80

Browse files
jic23dtor
authored andcommitted
Input: qt1050 - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
SIMPLE_DEV_PM_OPS() is deprecated as it requires explicit protection against unused function warnings. The new combination of pm_sleep_ptr() and DEFINE_SIMPLE_DEV_PM_OPS() allows the compiler to see the functions, thus suppressing the warning, but still allowing the unused code to be removed. Thus also drop the __maybe_unused markings. Signed-off-by: Jonathan Cameron <[email protected]> Reviewed-by: Marco Felsch <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Dmitry Torokhov <[email protected]>
1 parent b346200 commit ffa5d80

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

drivers/input/keyboard/qt1050.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -547,7 +547,7 @@ static int qt1050_probe(struct i2c_client *client)
547547
return 0;
548548
}
549549

550-
static int __maybe_unused qt1050_suspend(struct device *dev)
550+
static int qt1050_suspend(struct device *dev)
551551
{
552552
struct i2c_client *client = to_i2c_client(dev);
553553
struct qt1050_priv *ts = i2c_get_clientdata(client);
@@ -563,7 +563,7 @@ static int __maybe_unused qt1050_suspend(struct device *dev)
563563
device_may_wakeup(dev) ? 125 : 0);
564564
}
565565

566-
static int __maybe_unused qt1050_resume(struct device *dev)
566+
static int qt1050_resume(struct device *dev)
567567
{
568568
struct i2c_client *client = to_i2c_client(dev);
569569
struct qt1050_priv *ts = i2c_get_clientdata(client);
@@ -574,7 +574,7 @@ static int __maybe_unused qt1050_resume(struct device *dev)
574574
return regmap_write(ts->regmap, QT1050_LPMODE, 2);
575575
}
576576

577-
static SIMPLE_DEV_PM_OPS(qt1050_pm_ops, qt1050_suspend, qt1050_resume);
577+
static DEFINE_SIMPLE_DEV_PM_OPS(qt1050_pm_ops, qt1050_suspend, qt1050_resume);
578578

579579
static const struct of_device_id __maybe_unused qt1050_of_match[] = {
580580
{ .compatible = "microchip,qt1050", },
@@ -586,7 +586,7 @@ static struct i2c_driver qt1050_driver = {
586586
.driver = {
587587
.name = "qt1050",
588588
.of_match_table = of_match_ptr(qt1050_of_match),
589-
.pm = &qt1050_pm_ops,
589+
.pm = pm_sleep_ptr(&qt1050_pm_ops),
590590
},
591591
.probe_new = qt1050_probe,
592592
};

0 commit comments

Comments
 (0)