[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20190719115307.22124-1-hslester96@gmail.com>
Date: Fri, 19 Jul 2019 19:53:08 +0800
From: Chuhong Yuan <hslester96@...il.com>
To: unlisted-recipients:; (no To-header on input)
Cc: Dmitry Torokhov <dmitry.torokhov@...il.com>,
Shawn Guo <shawnguo@...nel.org>,
Sascha Hauer <s.hauer@...gutronix.de>,
linux-input@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
linux-kernel@...r.kernel.org, Chuhong Yuan <hslester96@...il.com>
Subject: [PATCH] Input: touchscreen - Use dev_get_drvdata
dev_get_drvdata is a simpler implementation comparing
to to_platform_device + platform_get_drvdata.
This makes the code simpler.
Signed-off-by: Chuhong Yuan <hslester96@...il.com>
---
drivers/input/touchscreen/imx6ul_tsc.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/input/touchscreen/imx6ul_tsc.c b/drivers/input/touchscreen/imx6ul_tsc.c
index e04eecd65bbb..655652f449ec 100644
--- a/drivers/input/touchscreen/imx6ul_tsc.c
+++ b/drivers/input/touchscreen/imx6ul_tsc.c
@@ -507,8 +507,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);
@@ -527,8 +526,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;
--
2.20.1
Powered by blists - more mailing lists