Received: by 10.192.165.156 with SMTP id m28csp762086imm; Thu, 19 Apr 2018 07:11:10 -0700 (PDT) X-Google-Smtp-Source: AIpwx495+pzh9TYsKASDgBJb5EKhp6KcMDE9WtQU08YD0+FPCuE74EUgfkzSwVOHOGru8+dz8SAO X-Received: by 10.99.95.76 with SMTP id t73mr5325255pgb.226.1524147070061; Thu, 19 Apr 2018 07:11:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524147070; cv=none; d=google.com; s=arc-20160816; b=BIi1G7xDZfaggexwixyAcO2T+S+YcNiZqwC4LqEddAnl9tMnka/YwBmt5HcpWZP4e6 x4ryedHBUAapSS2K5FqXVREqLgBak3EcHzXWskr8j6NVEMGW1pmBTu6B+WsJBnpkwo9C l1xn/eI6bqDPZpstDZ9YEVX8Q+papBqkiSq6NCOi983woi9nf+iMVYPQgvtXD9fC0+sq lHe0vAt75pxpt6ETHuR5xR1UQ+HauLe0Ol3Ts7xGGDx+pDaSxCaxgOruSce1o3eQ6CDp DZhS2hNZHlgIsjGfFvVNOx+8Y4cuqNi7bT/W9F3ZmhF/58UBC+7UkS08xP2Au4JUqeWI Q+og== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=GWmvtO89lEKQBY/kJtStvQQ/cowbWUSUvgRjzk1bLCw=; b=qdXRYx4pAFOKPQ8hV/+5kZFLomQHpgc2fspfX5mDG6Vfaze8G1yidMMVRJFpycEJU+ Ij8e9l5GLCghBjOxFPm/zd1THSla5BvYJk5WHIj+DhO0dKu86PbjJOI+dmpa8HkJRt8o FIMUfB2TSlXkkQUT+gjrJKjUVf+1/n2wQ+IVMkJpBw4ZkPHfx5Z5tWJj1D5/IM4boi+I iJGVFDTomIcOrkj1lyA3krRv/1cIEIeeEsvAZ76xd1Zm8OuefbnICQIuYlKg+JQimp5Z Uq6iiP0ur0eJXl9LUJU226cRJ0QFeSGRbtRqMvVkeD+RYz6a9g4r2a+TBSl2sXVvKlcU Z5dg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b10-v6si3610927pla.260.2018.04.19.07.10.56; Thu, 19 Apr 2018 07:11:10 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753587AbeDSOHQ (ORCPT + 99 others); Thu, 19 Apr 2018 10:07:16 -0400 Received: from sauhun.de ([88.99.104.3]:45350 "EHLO pokefinder.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753563AbeDSOHO (ORCPT ); Thu, 19 Apr 2018 10:07:14 -0400 Received: from localhost (unknown [145.253.130.2]) by pokefinder.org (Postfix) with ESMTPSA id 5B7853139DA; Thu, 19 Apr 2018 16:07:12 +0200 (CEST) From: Wolfram Sang To: linux-kernel@vger.kernel.org Cc: linux-renesas-soc@vger.kernel.org, kernel-janitors@vger.kernel.org, Wolfram Sang , Greg Kroah-Hartman , Jiri Slaby , Patrice Chotard , Michal Simek , linux-serial@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH 53/61] tty: serial: simplify getting .drvdata Date: Thu, 19 Apr 2018 16:06:23 +0200 Message-Id: <20180419140641.27926-54-wsa+renesas@sang-engineering.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180419140641.27926-1-wsa+renesas@sang-engineering.com> References: <20180419140641.27926-1-wsa+renesas@sang-engineering.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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/tty/serial/imx.c | 18 ++++++------------ drivers/tty/serial/qcom_geni_serial.c | 6 ++---- drivers/tty/serial/st-asc.c | 6 ++---- drivers/tty/serial/xilinx_uartps.c | 6 ++---- 4 files changed, 12 insertions(+), 24 deletions(-) diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c index 91f3a1a5cb7f..f370c1cf4f27 100644 --- a/drivers/tty/serial/imx.c +++ b/drivers/tty/serial/imx.c @@ -2408,8 +2408,7 @@ static void imx_uart_enable_wakeup(struct imx_port *sport, bool on) static int imx_uart_suspend_noirq(struct device *dev) { - struct platform_device *pdev = to_platform_device(dev); - struct imx_port *sport = platform_get_drvdata(pdev); + struct imx_port *sport = dev_get_drvdata(dev); imx_uart_save_context(sport); @@ -2420,8 +2419,7 @@ static int imx_uart_suspend_noirq(struct device *dev) static int imx_uart_resume_noirq(struct device *dev) { - struct platform_device *pdev = to_platform_device(dev); - struct imx_port *sport = platform_get_drvdata(pdev); + struct imx_port *sport = dev_get_drvdata(dev); int ret; ret = clk_enable(sport->clk_ipg); @@ -2435,8 +2433,7 @@ static int imx_uart_resume_noirq(struct device *dev) static int imx_uart_suspend(struct device *dev) { - struct platform_device *pdev = to_platform_device(dev); - struct imx_port *sport = platform_get_drvdata(pdev); + struct imx_port *sport = dev_get_drvdata(dev); int ret; uart_suspend_port(&imx_uart_uart_driver, &sport->port); @@ -2454,8 +2451,7 @@ static int imx_uart_suspend(struct device *dev) static int imx_uart_resume(struct device *dev) { - struct platform_device *pdev = to_platform_device(dev); - struct imx_port *sport = platform_get_drvdata(pdev); + struct imx_port *sport = dev_get_drvdata(dev); /* disable wakeup from i.MX UART */ imx_uart_enable_wakeup(sport, false); @@ -2470,8 +2466,7 @@ static int imx_uart_resume(struct device *dev) static int imx_uart_freeze(struct device *dev) { - struct platform_device *pdev = to_platform_device(dev); - struct imx_port *sport = platform_get_drvdata(pdev); + struct imx_port *sport = dev_get_drvdata(dev); uart_suspend_port(&imx_uart_uart_driver, &sport->port); @@ -2480,8 +2475,7 @@ static int imx_uart_freeze(struct device *dev) static int imx_uart_thaw(struct device *dev) { - struct platform_device *pdev = to_platform_device(dev); - struct imx_port *sport = platform_get_drvdata(pdev); + struct imx_port *sport = dev_get_drvdata(dev); uart_resume_port(&imx_uart_uart_driver, &sport->port); diff --git a/drivers/tty/serial/qcom_geni_serial.c b/drivers/tty/serial/qcom_geni_serial.c index 65ff669373d4..66558d42d980 100644 --- a/drivers/tty/serial/qcom_geni_serial.c +++ b/drivers/tty/serial/qcom_geni_serial.c @@ -1085,8 +1085,7 @@ static int qcom_geni_serial_remove(struct platform_device *pdev) static int __maybe_unused qcom_geni_serial_sys_suspend_noirq(struct device *dev) { - struct platform_device *pdev = to_platform_device(dev); - struct qcom_geni_serial_port *port = platform_get_drvdata(pdev); + struct qcom_geni_serial_port *port = dev_get_drvdata(dev); struct uart_port *uport = &port->uport; uart_suspend_port(uport->private_data, uport); @@ -1095,8 +1094,7 @@ static int __maybe_unused qcom_geni_serial_sys_suspend_noirq(struct device *dev) static int __maybe_unused qcom_geni_serial_sys_resume_noirq(struct device *dev) { - struct platform_device *pdev = to_platform_device(dev); - struct qcom_geni_serial_port *port = platform_get_drvdata(pdev); + struct qcom_geni_serial_port *port = dev_get_drvdata(dev); struct uart_port *uport = &port->uport; if (console_suspend_enabled && uport->suspended) { diff --git a/drivers/tty/serial/st-asc.c b/drivers/tty/serial/st-asc.c index 5f9f01fac6dd..7971997cdead 100644 --- a/drivers/tty/serial/st-asc.c +++ b/drivers/tty/serial/st-asc.c @@ -842,16 +842,14 @@ static int asc_serial_remove(struct platform_device *pdev) #ifdef CONFIG_PM_SLEEP static int asc_serial_suspend(struct device *dev) { - struct platform_device *pdev = to_platform_device(dev); - struct uart_port *port = platform_get_drvdata(pdev); + struct uart_port *port = dev_get_drvdata(dev); return uart_suspend_port(&asc_uart_driver, port); } static int asc_serial_resume(struct device *dev) { - struct platform_device *pdev = to_platform_device(dev); - struct uart_port *port = platform_get_drvdata(pdev); + struct uart_port *port = dev_get_drvdata(dev); return uart_resume_port(&asc_uart_driver, port); } diff --git a/drivers/tty/serial/xilinx_uartps.c b/drivers/tty/serial/xilinx_uartps.c index abcb4d09a2d8..3ec4efbf25a9 100644 --- a/drivers/tty/serial/xilinx_uartps.c +++ b/drivers/tty/serial/xilinx_uartps.c @@ -1430,8 +1430,7 @@ static int cdns_uart_resume(struct device *device) #endif /* ! CONFIG_PM_SLEEP */ static int __maybe_unused cdns_runtime_suspend(struct device *dev) { - struct platform_device *pdev = to_platform_device(dev); - struct uart_port *port = platform_get_drvdata(pdev); + struct uart_port *port = dev_get_drvdata(dev); struct cdns_uart *cdns_uart = port->private_data; clk_disable(cdns_uart->uartclk); @@ -1441,8 +1440,7 @@ static int __maybe_unused cdns_runtime_suspend(struct device *dev) static int __maybe_unused cdns_runtime_resume(struct device *dev) { - struct platform_device *pdev = to_platform_device(dev); - struct uart_port *port = platform_get_drvdata(pdev); + struct uart_port *port = dev_get_drvdata(dev); struct cdns_uart *cdns_uart = port->private_data; clk_enable(cdns_uart->pclk); -- 2.11.0