Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp3534802ybi; Fri, 19 Jul 2019 04:54:08 -0700 (PDT) X-Google-Smtp-Source: APXvYqxIFKNXekKTL4FQk/w844P6IoMqV4czVqFEnekgfRuMK3UlBkxJVuNNrJS2dB9A9SxaJjB1 X-Received: by 2002:a65:4841:: with SMTP id i1mr53427677pgs.316.1563537248432; Fri, 19 Jul 2019 04:54:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563537248; cv=none; d=google.com; s=arc-20160816; b=CT/BW4ArGxBhER0O9u6+H8dnki+ZyTz7Y2GfotaBNR6KcaCsXJpB1vJO9mVhscYV6a uBmA1JIsCL6Yl+cZSYMP7VlfKWvjuKubfUv5uMjg+fm3AnTvXrD7VujfAg/vBZKhl2Ie UFSGgg1oD5Pu4a36tTBUTYpBuvOdVa65kdCa2K47iK69QE7xBtyBiEbGIrF2GJ1C7p6T 8iY0zchPL1LYj+5d9CWiWh0Uy2LXnv2c6NrL7jPo82PWcdKOMs3b6KiBn88dZaQSHFev xOTjy6YD15ja011FDlz7c5D+P/CZeDH/WVf0gLmZ/uURR+YMi4MgMP38xvL/sbrWoTYc UDfA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:content-transfer-encoding:mime-version :message-id:date:subject:cc:from:dkim-signature; bh=7BQWVFk5xnfvY43V3HP4RUSBIEVm8NfFwU/OWhiUguc=; b=p3OoFF0mhqi6WNuvZMjd575aiUEhN4cYkUkBjXZ85zg5ldGiZCLthW4NBh03jtCpEq PJAYDr35o6np/OlA1IGZx5W6IWDkJpO02vjK2TFME2O2wZNiFNMkHJPUp+JdHCjH5fAF tdUDMQ1r3mBMalUV45nLW9V9dmvb3Iw0/Wc9/NMzoq1OZMQRXKmKHiO+P0wvo2p+I0rF elfvlrP1drJgCfjXvWFVFs92iO+CUwjLfS+eaoiO+CKehQxizhkJEmTY2YOPOdUJ8gKj 51IZBY5GCh0wIL+ZDOQ3onGkZmw8oE6yGLzwArt1N32NXPefbkk1iiohDtGD3QDOHUyj pEZw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=m14xS8Ld; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h69si450036pge.543.2019.07.19.04.53.52; Fri, 19 Jul 2019 04:54:08 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=m14xS8Ld; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728006AbfGSLx3 (ORCPT + 99 others); Fri, 19 Jul 2019 07:53:29 -0400 Received: from mail-pf1-f195.google.com ([209.85.210.195]:34280 "EHLO mail-pf1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726243AbfGSLx2 (ORCPT ); Fri, 19 Jul 2019 07:53:28 -0400 Received: by mail-pf1-f195.google.com with SMTP id b13so14093738pfo.1; Fri, 19 Jul 2019 04:53:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=7BQWVFk5xnfvY43V3HP4RUSBIEVm8NfFwU/OWhiUguc=; b=m14xS8Ld/wkugydyp1wPJICiD4EZ+GAzIwpCJUIwTOwmHroduRA2AOmXy/2OTSy/OH b2nY8TqpAn7eD29M+OJ7jQ0xs2NmYlTleUX8hIvZ4JCn4nOcKyWrTIoxOk7PHqw+2efO dVcoDfo17nQotY+imVuy8lIqw3klmXSskBNldqft1gmIyGmG2g8LMgOfs94K9S0arRIf 88aZ0VvQhi3NEMoQlfBebxeqbKVZTAJhII1aoMMX1cydv8DwmHNwZh2ooqHmwapnuDPy aWNzM32UK/trXBmqx3+upJTFRdcUYLqJIoP5BmNjuyTF+4U5ThU/l2qwHix6qP6/il0H 7N6A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=7BQWVFk5xnfvY43V3HP4RUSBIEVm8NfFwU/OWhiUguc=; b=P9qDg6maCC+ogAYcRtq2GEW5GI5t/9sLDFg2OYFQREGEvYBV+NwUNT9BwWq7lD/7WT +SqSLZQSXPRCYcQGKDMrjGO92WqjBe936FOi6PmQfMW9Rqs/SV+fRMqlYuqDpKn3sUUR ClIxTDejHeW9Z3/K3yedDEjLquRB4JRj+p32HE367BeDScfkU/0ovP4TaCAB5ClAADhm NMV6EppExeaXGLJxrpcaRFaiFmf4WBfzPugffwIb/r/F+1TF0iEe33j71bT2cwrskV2O 1CVhFgvYGAFgqazT5lECsQe0DXCRDcICM60YX1xoMvNrz8VzoxAR6OSejQD/RjCZzxOb YHVg== X-Gm-Message-State: APjAAAX/Cg2OTGXyzuvu+Lr18snDgLSjKIC81rnMH0rVT13ZDqQ6487H ZD2GNgSGt7Wd2pTDJGG5hsY= X-Received: by 2002:a63:4c17:: with SMTP id z23mr14499235pga.167.1563537208055; Fri, 19 Jul 2019 04:53:28 -0700 (PDT) Received: from suzukaze.ipads-lab.se.sjtu.edu.cn ([89.31.126.54]) by smtp.gmail.com with ESMTPSA id v184sm30587380pfb.82.2019.07.19.04.53.25 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Fri, 19 Jul 2019 04:53:27 -0700 (PDT) From: Chuhong Yuan Cc: Dmitry Torokhov , Shawn Guo , Sascha Hauer , linux-input@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Chuhong Yuan Subject: [PATCH] Input: touchscreen - Use dev_get_drvdata Date: Fri, 19 Jul 2019 19:53:08 +0800 Message-Id: <20190719115307.22124-1-hslester96@gmail.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit To: unlisted-recipients:; (no To-header on input) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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