Skip to content

Commit

Permalink
Input: bu21013_ts - annotate supend/resume methods as __maybe_unused
Browse files Browse the repository at this point in the history
Instead if #ifdef-ing out suspend and resume methods, let's mark
them as __maybe_unused to get better compile time coverage.

Tested-by: Linus Walleij <[email protected]>
Signed-off-by: Dmitry Torokhov <[email protected]>
  • Loading branch information
dtor committed Sep 2, 2019
1 parent a866781 commit 0570bab
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions drivers/input/touchscreen/bu21013_ts.c
Original file line number Diff line number Diff line change
Expand Up @@ -634,15 +634,14 @@ static int bu21013_remove(struct i2c_client *client)
return 0;
}

#ifdef CONFIG_PM
/**
* bu21013_suspend() - suspend the touch screen controller
* @dev: pointer to device structure
*
* This function is used to suspend the
* touch panel controller and returns integer
*/
static int bu21013_suspend(struct device *dev)
static int __maybe_unused bu21013_suspend(struct device *dev)
{
struct bu21013_ts *ts = dev_get_drvdata(dev);
struct i2c_client *client = ts->client;
Expand All @@ -665,7 +664,7 @@ static int bu21013_suspend(struct device *dev)
* This function is used to resume the touch panel
* controller and returns integer.
*/
static int bu21013_resume(struct device *dev)
static int __maybe_unused bu21013_resume(struct device *dev)
{
struct bu21013_ts *ts = dev_get_drvdata(dev);
struct i2c_client *client = ts->client;
Expand Down Expand Up @@ -693,11 +692,7 @@ static int bu21013_resume(struct device *dev)
return 0;
}

static const struct dev_pm_ops bu21013_dev_pm_ops = {
.suspend = bu21013_suspend,
.resume = bu21013_resume,
};
#endif
static SIMPLE_DEV_PM_OPS(bu21013_dev_pm_ops, bu21013_suspend, bu21013_resume);

static const struct i2c_device_id bu21013_id[] = {
{ DRIVER_TP, 0 },
Expand All @@ -708,9 +703,7 @@ MODULE_DEVICE_TABLE(i2c, bu21013_id);
static struct i2c_driver bu21013_driver = {
.driver = {
.name = DRIVER_TP,
#ifdef CONFIG_PM
.pm = &bu21013_dev_pm_ops,
#endif
},
.probe = bu21013_probe,
.remove = bu21013_remove,
Expand Down

0 comments on commit 0570bab

Please sign in to comment.