From mboxrd@z Thu Jan 1 00:00:00 1970 From: Wolfram Sang Subject: [PATCH 23/61] input: touchscreen: simplify getting .drvdata Date: Thu, 19 Apr 2018 16:05:53 +0200 Message-ID: <20180419140641.27926-24-wsa+renesas@sang-engineering.com> References: <20180419140641.27926-1-wsa+renesas@sang-engineering.com> Return-path: In-Reply-To: <20180419140641.27926-1-wsa+renesas@sang-engineering.com> Sender: linux-kernel-owner@vger.kernel.org To: linux-kernel@vger.kernel.org Cc: linux-renesas-soc@vger.kernel.org, kernel-janitors@vger.kernel.org, Wolfram Sang , Dmitry Torokhov , linux-input@vger.kernel.org List-Id: linux-input@vger.kernel.org We should get drvdata from struct device directly. Going via platform_device is an unneeded step back and forth. Signed-off-by: Wolfram Sang --- Build tested only. buildbot is happy. Please apply individually. 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 ee82a975bfd2..da9e0a774e4b 100644 --- a/drivers/input/touchscreen/imx6ul_tsc.c +++ b/drivers/input/touchscreen/imx6ul_tsc.c @@ -515,8 +515,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); @@ -535,8 +534,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.11.0