@@ -511,8 +511,7 @@ static int imx6ul_tsc_probe(struct platform_device *pdev)
static int __maybe_unused imx6ul_tsc_suspend(struct device *dev)
{
- struct platform_device *pdev = to_platform_device(dev);
- struct imx6ul_tsc *tsc = platform_get_drvdata(pdev);
+ struct imx6ul_tsc *tsc = dev_get_drvdata(dev);
struct input_dev *input_dev = tsc->input;
mutex_lock(&input_dev->mutex);
@@ -531,8 +530,7 @@ static int __maybe_unused imx6ul_tsc_suspend(struct device *dev)
static int __maybe_unused imx6ul_tsc_resume(struct device *dev)
{
- struct platform_device *pdev = to_platform_device(dev);
- struct imx6ul_tsc *tsc = platform_get_drvdata(pdev);
+ struct imx6ul_tsc *tsc = dev_get_drvdata(dev);
struct input_dev *input_dev = tsc->input;
int retval = 0;
@@ -396,8 +396,7 @@ static int s3c2410ts_suspend(struct device *dev)
static int s3c2410ts_resume(struct device *dev)
{
- struct platform_device *pdev = to_platform_device(dev);
- struct s3c2410_ts_mach_info *info = dev_get_platdata(&pdev->dev);
+ struct s3c2410_ts_mach_info *info = dev_get_platdata(dev);
clk_enable(ts.clock);
enable_irq(ts.irq_tc);
Using dev_get_drvdata directly. Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com> Cc: Shawn Guo <shawnguo@kernel.org> Cc: Sascha Hauer <s.hauer@pengutronix.de> Cc: linux-input@vger.kernel.org Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com> --- drivers/input/touchscreen/imx6ul_tsc.c | 6 ++---- drivers/input/touchscreen/s3c2410_ts.c | 3 +-- 2 files changed, 3 insertions(+), 6 deletions(-)