Skip to content

Commit 28bbeca

Browse files
jic23dtor
authored andcommitted
Input: cyapa - switch to SYSTEM_SLEEP/RUNTIME_PM_OPS() and pm_ptr()
SET_SYSTEM_SLEEP_PM_OPS() and SET_RUNTIME_PM_OPS() are deprecated as they require explicit protection against unused function warnings. The new combination of pm_ptr() and SYSTEM_SLEEP_PM_OPS()/ RUNTIME_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]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Dmitry Torokhov <[email protected]>
1 parent 8aaec11 commit 28bbeca

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

drivers/input/mouse/cyapa.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1349,7 +1349,7 @@ static int cyapa_probe(struct i2c_client *client)
13491349
return 0;
13501350
}
13511351

1352-
static int __maybe_unused cyapa_suspend(struct device *dev)
1352+
static int cyapa_suspend(struct device *dev)
13531353
{
13541354
struct i2c_client *client = to_i2c_client(dev);
13551355
struct cyapa *cyapa = i2c_get_clientdata(client);
@@ -1397,7 +1397,7 @@ static int __maybe_unused cyapa_suspend(struct device *dev)
13971397
return 0;
13981398
}
13991399

1400-
static int __maybe_unused cyapa_resume(struct device *dev)
1400+
static int cyapa_resume(struct device *dev)
14011401
{
14021402
struct i2c_client *client = to_i2c_client(dev);
14031403
struct cyapa *cyapa = i2c_get_clientdata(client);
@@ -1424,7 +1424,7 @@ static int __maybe_unused cyapa_resume(struct device *dev)
14241424
return 0;
14251425
}
14261426

1427-
static int __maybe_unused cyapa_runtime_suspend(struct device *dev)
1427+
static int cyapa_runtime_suspend(struct device *dev)
14281428
{
14291429
struct cyapa *cyapa = dev_get_drvdata(dev);
14301430
int error;
@@ -1439,7 +1439,7 @@ static int __maybe_unused cyapa_runtime_suspend(struct device *dev)
14391439
return 0;
14401440
}
14411441

1442-
static int __maybe_unused cyapa_runtime_resume(struct device *dev)
1442+
static int cyapa_runtime_resume(struct device *dev)
14431443
{
14441444
struct cyapa *cyapa = dev_get_drvdata(dev);
14451445
int error;
@@ -1453,8 +1453,8 @@ static int __maybe_unused cyapa_runtime_resume(struct device *dev)
14531453
}
14541454

14551455
static const struct dev_pm_ops cyapa_pm_ops = {
1456-
SET_SYSTEM_SLEEP_PM_OPS(cyapa_suspend, cyapa_resume)
1457-
SET_RUNTIME_PM_OPS(cyapa_runtime_suspend, cyapa_runtime_resume, NULL)
1456+
SYSTEM_SLEEP_PM_OPS(cyapa_suspend, cyapa_resume)
1457+
RUNTIME_PM_OPS(cyapa_runtime_suspend, cyapa_runtime_resume, NULL)
14581458
};
14591459

14601460
static const struct i2c_device_id cyapa_id_table[] = {
@@ -1484,7 +1484,7 @@ MODULE_DEVICE_TABLE(of, cyapa_of_match);
14841484
static struct i2c_driver cyapa_driver = {
14851485
.driver = {
14861486
.name = "cyapa",
1487-
.pm = &cyapa_pm_ops,
1487+
.pm = pm_ptr(&cyapa_pm_ops),
14881488
.acpi_match_table = ACPI_PTR(cyapa_acpi_id),
14891489
.of_match_table = of_match_ptr(cyapa_of_match),
14901490
},

0 commit comments

Comments
 (0)