--- zzzz-none-000/linux-3.10.107/drivers/input/touchscreen/ad7879.c 2017-06-27 09:49:32.000000000 +0000 +++ scorpion-7490-727/linux-3.10.107/drivers/input/touchscreen/ad7879.c 2021-02-04 17:41:59.000000000 +0000 @@ -22,7 +22,6 @@ */ #include -#include #include #include #include @@ -285,8 +284,7 @@ __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); @@ -302,7 +300,7 @@ 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); @@ -317,7 +315,6 @@ return 0; } -#endif SIMPLE_DEV_PM_OPS(ad7879_pm_ops, ad7879_suspend, ad7879_resume); EXPORT_SYMBOL(ad7879_pm_ops); @@ -470,15 +467,11 @@ static void ad7879_gpio_remove(struct ad7879 *ts) { - const struct ad7879_platform_data *pdata = ts->dev->platform_data; - int ret; + const struct ad7879_platform_data *pdata = dev_get_platdata(ts->dev); + + if (pdata->gpio_export) + gpiochip_remove(&ts->gc); - if (pdata->gpio_export) { - ret = gpiochip_remove(&ts->gc); - if (ret) - dev_err(ts->dev, "failed to remove gpio %d\n", - ts->gc.base); - } } #else static inline int ad7879_gpio_add(struct ad7879 *ts, @@ -495,7 +488,7 @@ struct ad7879 *ad7879_probe(struct device *dev, u8 devid, unsigned int irq, const struct ad7879_bus_ops *bops) { - struct ad7879_platform_data *pdata = dev->platform_data; + struct ad7879_platform_data *pdata = dev_get_platdata(dev); struct ad7879 *ts; struct input_dev *input_dev; int err;