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

Configure Feed

Select the types of activity you want to include in your feed.

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 <Jonathan.Cameron@huawei.com>
Link: https://lore.kernel.org/r/20230114171620.42891-2-jic23@kernel.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>

authored by

Jonathan Cameron and committed by
Dmitry Torokhov
28bbeca2 8aaec117

+7 -7
+7 -7
drivers/input/mouse/cyapa.c
··· 1349 1349 return 0; 1350 1350 } 1351 1351 1352 - static int __maybe_unused cyapa_suspend(struct device *dev) 1352 + static int cyapa_suspend(struct device *dev) 1353 1353 { 1354 1354 struct i2c_client *client = to_i2c_client(dev); 1355 1355 struct cyapa *cyapa = i2c_get_clientdata(client); ··· 1397 1397 return 0; 1398 1398 } 1399 1399 1400 - static int __maybe_unused cyapa_resume(struct device *dev) 1400 + static int cyapa_resume(struct device *dev) 1401 1401 { 1402 1402 struct i2c_client *client = to_i2c_client(dev); 1403 1403 struct cyapa *cyapa = i2c_get_clientdata(client); ··· 1424 1424 return 0; 1425 1425 } 1426 1426 1427 - static int __maybe_unused cyapa_runtime_suspend(struct device *dev) 1427 + static int cyapa_runtime_suspend(struct device *dev) 1428 1428 { 1429 1429 struct cyapa *cyapa = dev_get_drvdata(dev); 1430 1430 int error; ··· 1439 1439 return 0; 1440 1440 } 1441 1441 1442 - static int __maybe_unused cyapa_runtime_resume(struct device *dev) 1442 + static int cyapa_runtime_resume(struct device *dev) 1443 1443 { 1444 1444 struct cyapa *cyapa = dev_get_drvdata(dev); 1445 1445 int error; ··· 1453 1453 } 1454 1454 1455 1455 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) 1458 1458 }; 1459 1459 1460 1460 static const struct i2c_device_id cyapa_id_table[] = { ··· 1484 1484 static struct i2c_driver cyapa_driver = { 1485 1485 .driver = { 1486 1486 .name = "cyapa", 1487 - .pm = &cyapa_pm_ops, 1487 + .pm = pm_ptr(&cyapa_pm_ops), 1488 1488 .acpi_match_table = ACPI_PTR(cyapa_acpi_id), 1489 1489 .of_match_table = of_match_ptr(cyapa_of_match), 1490 1490 },