Skip to content

Commit

Permalink
Input: touchscreen - use __maybe_unused instead of ifdef around suspe…
Browse files Browse the repository at this point in the history
…nd/resume

Use __maybe_unused instead of ifdef guards around suspend/resume
functions, in order to increase build coverage and fix build warnings.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
  • Loading branch information
Jingoo Han authored and Dmitry Torokhov committed Nov 2, 2014
1 parent 572081a commit 02b6a58
Show file tree
Hide file tree
Showing 19 changed files with 38 additions and 78 deletions.
6 changes: 2 additions & 4 deletions drivers/input/touchscreen/ad7877.c
Original file line number Diff line number Diff line change
Expand Up @@ -820,8 +820,7 @@ static int ad7877_remove(struct spi_device *spi)
return 0;
}

#ifdef CONFIG_PM_SLEEP
static int ad7877_suspend(struct device *dev)
static int __maybe_unused ad7877_suspend(struct device *dev)
{
struct ad7877 *ts = dev_get_drvdata(dev);

Expand All @@ -830,15 +829,14 @@ static int ad7877_suspend(struct device *dev)
return 0;
}

static int ad7877_resume(struct device *dev)
static int __maybe_unused ad7877_resume(struct device *dev)
{
struct ad7877 *ts = dev_get_drvdata(dev);

ad7877_enable(ts);

return 0;
}
#endif

static SIMPLE_DEV_PM_OPS(ad7877_pm, ad7877_suspend, ad7877_resume);

Expand Down
6 changes: 2 additions & 4 deletions drivers/input/touchscreen/ad7879.c
Original file line number Diff line number Diff line change
Expand Up @@ -284,8 +284,7 @@ static void ad7879_close(struct input_dev* input)
__ad7879_disable(ts);
}

#ifdef CONFIG_PM_SLEEP
static int ad7879_suspend(struct device *dev)
static int __maybe_unused ad7879_suspend(struct device *dev)
{
struct ad7879 *ts = dev_get_drvdata(dev);

Expand All @@ -301,7 +300,7 @@ static int ad7879_suspend(struct device *dev)
return 0;
}

static int ad7879_resume(struct device *dev)
static int __maybe_unused ad7879_resume(struct device *dev)
{
struct ad7879 *ts = dev_get_drvdata(dev);

Expand All @@ -316,7 +315,6 @@ static int ad7879_resume(struct device *dev)

return 0;
}
#endif

SIMPLE_DEV_PM_OPS(ad7879_pm_ops, ad7879_suspend, ad7879_resume);
EXPORT_SYMBOL(ad7879_pm_ops);
Expand Down
6 changes: 2 additions & 4 deletions drivers/input/touchscreen/ads7846.c
Original file line number Diff line number Diff line change
Expand Up @@ -883,8 +883,7 @@ static irqreturn_t ads7846_irq(int irq, void *handle)
return IRQ_HANDLED;
}

#ifdef CONFIG_PM_SLEEP
static int ads7846_suspend(struct device *dev)
static int __maybe_unused ads7846_suspend(struct device *dev)
{
struct ads7846 *ts = dev_get_drvdata(dev);

Expand All @@ -906,7 +905,7 @@ static int ads7846_suspend(struct device *dev)
return 0;
}

static int ads7846_resume(struct device *dev)
static int __maybe_unused ads7846_resume(struct device *dev)
{
struct ads7846 *ts = dev_get_drvdata(dev);

Expand All @@ -927,7 +926,6 @@ static int ads7846_resume(struct device *dev)

return 0;
}
#endif

static SIMPLE_DEV_PM_OPS(ads7846_pm, ads7846_suspend, ads7846_resume);

Expand Down
6 changes: 2 additions & 4 deletions drivers/input/touchscreen/atmel_mxt_ts.c
Original file line number Diff line number Diff line change
Expand Up @@ -2244,8 +2244,7 @@ static int mxt_remove(struct i2c_client *client)
return 0;
}

#ifdef CONFIG_PM_SLEEP
static int mxt_suspend(struct device *dev)
static int __maybe_unused mxt_suspend(struct device *dev)
{
struct i2c_client *client = to_i2c_client(dev);
struct mxt_data *data = i2c_get_clientdata(client);
Expand All @@ -2261,7 +2260,7 @@ static int mxt_suspend(struct device *dev)
return 0;
}

static int mxt_resume(struct device *dev)
static int __maybe_unused mxt_resume(struct device *dev)
{
struct i2c_client *client = to_i2c_client(dev);
struct mxt_data *data = i2c_get_clientdata(client);
Expand All @@ -2276,7 +2275,6 @@ static int mxt_resume(struct device *dev)

return 0;
}
#endif

static SIMPLE_DEV_PM_OPS(mxt_pm_ops, mxt_suspend, mxt_resume);

Expand Down
6 changes: 2 additions & 4 deletions drivers/input/touchscreen/auo-pixcir-ts.c
Original file line number Diff line number Diff line change
Expand Up @@ -417,8 +417,7 @@ static void auo_pixcir_input_close(struct input_dev *dev)
return;
}

#ifdef CONFIG_PM_SLEEP
static int auo_pixcir_suspend(struct device *dev)
static int __maybe_unused auo_pixcir_suspend(struct device *dev)
{
struct i2c_client *client = to_i2c_client(dev);
struct auo_pixcir_ts *ts = i2c_get_clientdata(client);
Expand Down Expand Up @@ -450,7 +449,7 @@ static int auo_pixcir_suspend(struct device *dev)
return ret;
}

static int auo_pixcir_resume(struct device *dev)
static int __maybe_unused auo_pixcir_resume(struct device *dev)
{
struct i2c_client *client = to_i2c_client(dev);
struct auo_pixcir_ts *ts = i2c_get_clientdata(client);
Expand Down Expand Up @@ -479,7 +478,6 @@ static int auo_pixcir_resume(struct device *dev)

return ret;
}
#endif

static SIMPLE_DEV_PM_OPS(auo_pixcir_pm_ops,
auo_pixcir_suspend, auo_pixcir_resume);
Expand Down
6 changes: 2 additions & 4 deletions drivers/input/touchscreen/cy8ctmg110_ts.c
Original file line number Diff line number Diff line change
Expand Up @@ -291,8 +291,7 @@ static int cy8ctmg110_probe(struct i2c_client *client,
return err;
}

#ifdef CONFIG_PM_SLEEP
static int cy8ctmg110_suspend(struct device *dev)
static int __maybe_unused cy8ctmg110_suspend(struct device *dev)
{
struct i2c_client *client = to_i2c_client(dev);
struct cy8ctmg110 *ts = i2c_get_clientdata(client);
Expand All @@ -306,7 +305,7 @@ static int cy8ctmg110_suspend(struct device *dev)
return 0;
}

static int cy8ctmg110_resume(struct device *dev)
static int __maybe_unused cy8ctmg110_resume(struct device *dev)
{
struct i2c_client *client = to_i2c_client(dev);
struct cy8ctmg110 *ts = i2c_get_clientdata(client);
Expand All @@ -319,7 +318,6 @@ static int cy8ctmg110_resume(struct device *dev)
}
return 0;
}
#endif

static SIMPLE_DEV_PM_OPS(cy8ctmg110_pm, cy8ctmg110_suspend, cy8ctmg110_resume);

Expand Down
7 changes: 2 additions & 5 deletions drivers/input/touchscreen/cyttsp_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -472,8 +472,7 @@ static int cyttsp_disable(struct cyttsp *ts)
return 0;
}

#ifdef CONFIG_PM_SLEEP
static int cyttsp_suspend(struct device *dev)
static int __maybe_unused cyttsp_suspend(struct device *dev)
{
struct cyttsp *ts = dev_get_drvdata(dev);
int retval = 0;
Expand All @@ -491,7 +490,7 @@ static int cyttsp_suspend(struct device *dev)
return retval;
}

static int cyttsp_resume(struct device *dev)
static int __maybe_unused cyttsp_resume(struct device *dev)
{
struct cyttsp *ts = dev_get_drvdata(dev);

Expand All @@ -507,8 +506,6 @@ static int cyttsp_resume(struct device *dev)
return 0;
}

#endif

SIMPLE_DEV_PM_OPS(cyttsp_pm_ops, cyttsp_suspend, cyttsp_resume);
EXPORT_SYMBOL_GPL(cyttsp_pm_ops);

Expand Down
6 changes: 2 additions & 4 deletions drivers/input/touchscreen/edt-ft5x06.c
Original file line number Diff line number Diff line change
Expand Up @@ -1092,8 +1092,7 @@ static int edt_ft5x06_ts_remove(struct i2c_client *client)
return 0;
}

#ifdef CONFIG_PM_SLEEP
static int edt_ft5x06_ts_suspend(struct device *dev)
static int __maybe_unused edt_ft5x06_ts_suspend(struct device *dev)
{
struct i2c_client *client = to_i2c_client(dev);

Expand All @@ -1103,7 +1102,7 @@ static int edt_ft5x06_ts_suspend(struct device *dev)
return 0;
}

static int edt_ft5x06_ts_resume(struct device *dev)
static int __maybe_unused edt_ft5x06_ts_resume(struct device *dev)
{
struct i2c_client *client = to_i2c_client(dev);

Expand All @@ -1112,7 +1111,6 @@ static int edt_ft5x06_ts_resume(struct device *dev)

return 0;
}
#endif

static SIMPLE_DEV_PM_OPS(edt_ft5x06_ts_pm_ops,
edt_ft5x06_ts_suspend, edt_ft5x06_ts_resume);
Expand Down
6 changes: 2 additions & 4 deletions drivers/input/touchscreen/eeti_ts.c
Original file line number Diff line number Diff line change
Expand Up @@ -264,8 +264,7 @@ static int eeti_ts_remove(struct i2c_client *client)
return 0;
}

#ifdef CONFIG_PM_SLEEP
static int eeti_ts_suspend(struct device *dev)
static int __maybe_unused eeti_ts_suspend(struct device *dev)
{
struct i2c_client *client = to_i2c_client(dev);
struct eeti_ts_priv *priv = i2c_get_clientdata(client);
Expand All @@ -284,7 +283,7 @@ static int eeti_ts_suspend(struct device *dev)
return 0;
}

static int eeti_ts_resume(struct device *dev)
static int __maybe_unused eeti_ts_resume(struct device *dev)
{
struct i2c_client *client = to_i2c_client(dev);
struct eeti_ts_priv *priv = i2c_get_clientdata(client);
Expand All @@ -302,7 +301,6 @@ static int eeti_ts_resume(struct device *dev)

return 0;
}
#endif

static SIMPLE_DEV_PM_OPS(eeti_ts_pm, eeti_ts_suspend, eeti_ts_resume);

Expand Down
6 changes: 2 additions & 4 deletions drivers/input/touchscreen/egalax_ts.c
Original file line number Diff line number Diff line change
Expand Up @@ -239,8 +239,7 @@ static const struct i2c_device_id egalax_ts_id[] = {
};
MODULE_DEVICE_TABLE(i2c, egalax_ts_id);

#ifdef CONFIG_PM_SLEEP
static int egalax_ts_suspend(struct device *dev)
static int __maybe_unused egalax_ts_suspend(struct device *dev)
{
static const u8 suspend_cmd[MAX_I2C_DATA_LEN] = {
0x3, 0x6, 0xa, 0x3, 0x36, 0x3f, 0x2, 0, 0, 0
Expand All @@ -252,13 +251,12 @@ static int egalax_ts_suspend(struct device *dev)
return ret > 0 ? 0 : ret;
}

static int egalax_ts_resume(struct device *dev)
static int __maybe_unused egalax_ts_resume(struct device *dev)
{
struct i2c_client *client = to_i2c_client(dev);

return egalax_wake_up_device(client);
}
#endif

static SIMPLE_DEV_PM_OPS(egalax_ts_pm_ops, egalax_ts_suspend, egalax_ts_resume);

Expand Down
6 changes: 2 additions & 4 deletions drivers/input/touchscreen/ili210x.c
Original file line number Diff line number Diff line change
Expand Up @@ -311,8 +311,7 @@ static int ili210x_i2c_remove(struct i2c_client *client)
return 0;
}

#ifdef CONFIG_PM_SLEEP
static int ili210x_i2c_suspend(struct device *dev)
static int __maybe_unused ili210x_i2c_suspend(struct device *dev)
{
struct i2c_client *client = to_i2c_client(dev);

Expand All @@ -322,7 +321,7 @@ static int ili210x_i2c_suspend(struct device *dev)
return 0;
}

static int ili210x_i2c_resume(struct device *dev)
static int __maybe_unused ili210x_i2c_resume(struct device *dev)
{
struct i2c_client *client = to_i2c_client(dev);

Expand All @@ -331,7 +330,6 @@ static int ili210x_i2c_resume(struct device *dev)

return 0;
}
#endif

static SIMPLE_DEV_PM_OPS(ili210x_i2c_pm,
ili210x_i2c_suspend, ili210x_i2c_resume);
Expand Down
6 changes: 2 additions & 4 deletions drivers/input/touchscreen/ipaq-micro-ts.c
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,7 @@ static int micro_ts_probe(struct platform_device *pdev)
return 0;
}

#ifdef CONFIG_PM_SLEEP
static int micro_ts_suspend(struct device *dev)
static int __maybe_unused micro_ts_suspend(struct device *dev)
{
struct touchscreen_data *ts = dev_get_drvdata(dev);

Expand All @@ -132,7 +131,7 @@ static int micro_ts_suspend(struct device *dev)
return 0;
}

static int micro_ts_resume(struct device *dev)
static int __maybe_unused micro_ts_resume(struct device *dev)
{
struct touchscreen_data *ts = dev_get_drvdata(dev);
struct input_dev *input = ts->input;
Expand All @@ -146,7 +145,6 @@ static int micro_ts_resume(struct device *dev)

return 0;
}
#endif

static const struct dev_pm_ops micro_ts_dev_pm_ops = {
SET_SYSTEM_SLEEP_PM_OPS(micro_ts_suspend, micro_ts_resume)
Expand Down
6 changes: 2 additions & 4 deletions drivers/input/touchscreen/mms114.c
Original file line number Diff line number Diff line change
Expand Up @@ -515,8 +515,7 @@ static int mms114_probe(struct i2c_client *client,
return 0;
}

#ifdef CONFIG_PM_SLEEP
static int mms114_suspend(struct device *dev)
static int __maybe_unused mms114_suspend(struct device *dev)
{
struct i2c_client *client = to_i2c_client(dev);
struct mms114_data *data = i2c_get_clientdata(client);
Expand All @@ -540,7 +539,7 @@ static int mms114_suspend(struct device *dev)
return 0;
}

static int mms114_resume(struct device *dev)
static int __maybe_unused mms114_resume(struct device *dev)
{
struct i2c_client *client = to_i2c_client(dev);
struct mms114_data *data = i2c_get_clientdata(client);
Expand All @@ -559,7 +558,6 @@ static int mms114_resume(struct device *dev)

return 0;
}
#endif

static SIMPLE_DEV_PM_OPS(mms114_pm_ops, mms114_suspend, mms114_resume);

Expand Down
6 changes: 2 additions & 4 deletions drivers/input/touchscreen/pixcir_i2c_ts.c
Original file line number Diff line number Diff line change
Expand Up @@ -347,8 +347,7 @@ static void pixcir_input_close(struct input_dev *dev)
pixcir_stop(ts);
}

#ifdef CONFIG_PM_SLEEP
static int pixcir_i2c_ts_suspend(struct device *dev)
static int __maybe_unused pixcir_i2c_ts_suspend(struct device *dev)
{
struct i2c_client *client = to_i2c_client(dev);
struct pixcir_i2c_ts_data *ts = i2c_get_clientdata(client);
Expand Down Expand Up @@ -377,7 +376,7 @@ static int pixcir_i2c_ts_suspend(struct device *dev)
return ret;
}

static int pixcir_i2c_ts_resume(struct device *dev)
static int __maybe_unused pixcir_i2c_ts_resume(struct device *dev)
{
struct i2c_client *client = to_i2c_client(dev);
struct pixcir_i2c_ts_data *ts = i2c_get_clientdata(client);
Expand Down Expand Up @@ -405,7 +404,6 @@ static int pixcir_i2c_ts_resume(struct device *dev)

return ret;
}
#endif

static SIMPLE_DEV_PM_OPS(pixcir_dev_pm_ops,
pixcir_i2c_ts_suspend, pixcir_i2c_ts_resume);
Expand Down
Loading

0 comments on commit 02b6a58

Please sign in to comment.