From patchwork Thu Apr 19 14:06:27 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wolfram Sang X-Patchwork-Id: 10350493 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 0CD7560231 for ; Thu, 19 Apr 2018 14:10:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F183D289E1 for ; Thu, 19 Apr 2018 14:10:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E5FFA28A16; Thu, 19 Apr 2018 14:10:27 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8B28B289E1 for ; Thu, 19 Apr 2018 14:10:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753643AbeDSOJy (ORCPT ); Thu, 19 Apr 2018 10:09:54 -0400 Received: from sauhun.de ([88.99.104.3]:45416 "EHLO pokefinder.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753566AbeDSOHP (ORCPT ); Thu, 19 Apr 2018 10:07:15 -0400 Received: from localhost (unknown [145.253.130.2]) by pokefinder.org (Postfix) with ESMTPSA id 300463139BE; Thu, 19 Apr 2018 16:07:14 +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 , Bartlomiej Zolnierkiewicz , dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org Subject: [PATCH 57/61] video: fbdev: simplify getting .drvdata Date: Thu, 19 Apr 2018 16:06:27 +0200 Message-Id: <20180419140641.27926-58-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-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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/video/fbdev/auo_k190x.c | 12 ++++-------- drivers/video/fbdev/sh_mobile_lcdcfb.c | 6 ++---- drivers/video/fbdev/sh_mobile_meram.c | 6 ++---- 3 files changed, 8 insertions(+), 16 deletions(-) diff --git a/drivers/video/fbdev/auo_k190x.c b/drivers/video/fbdev/auo_k190x.c index 9d24d1b3e9ef..9bf6a6e02342 100644 --- a/drivers/video/fbdev/auo_k190x.c +++ b/drivers/video/fbdev/auo_k190x.c @@ -776,8 +776,7 @@ static void auok190x_recover(struct auok190xfb_par *par) */ static int __maybe_unused auok190x_runtime_suspend(struct device *dev) { - struct platform_device *pdev = to_platform_device(dev); - struct fb_info *info = platform_get_drvdata(pdev); + struct fb_info *info = dev_get_drvdata(dev); struct auok190xfb_par *par = info->par; struct auok190x_board *board = par->board; u16 standby_param; @@ -823,8 +822,7 @@ static int __maybe_unused auok190x_runtime_suspend(struct device *dev) static int __maybe_unused auok190x_runtime_resume(struct device *dev) { - struct platform_device *pdev = to_platform_device(dev); - struct fb_info *info = platform_get_drvdata(pdev); + struct fb_info *info = dev_get_drvdata(dev); struct auok190xfb_par *par = info->par; struct auok190x_board *board = par->board; @@ -857,8 +855,7 @@ static int __maybe_unused auok190x_runtime_resume(struct device *dev) static int __maybe_unused auok190x_suspend(struct device *dev) { - struct platform_device *pdev = to_platform_device(dev); - struct fb_info *info = platform_get_drvdata(pdev); + struct fb_info *info = dev_get_drvdata(dev); struct auok190xfb_par *par = info->par; struct auok190x_board *board = par->board; int ret; @@ -897,8 +894,7 @@ static int __maybe_unused auok190x_suspend(struct device *dev) static int __maybe_unused auok190x_resume(struct device *dev) { - struct platform_device *pdev = to_platform_device(dev); - struct fb_info *info = platform_get_drvdata(pdev); + struct fb_info *info = dev_get_drvdata(dev); struct auok190xfb_par *par = info->par; struct auok190x_board *board = par->board; diff --git a/drivers/video/fbdev/sh_mobile_lcdcfb.c b/drivers/video/fbdev/sh_mobile_lcdcfb.c index c3a46506e47e..86bd4090b011 100644 --- a/drivers/video/fbdev/sh_mobile_lcdcfb.c +++ b/drivers/video/fbdev/sh_mobile_lcdcfb.c @@ -2354,8 +2354,7 @@ static int sh_mobile_lcdc_resume(struct device *dev) static int sh_mobile_lcdc_runtime_suspend(struct device *dev) { - struct platform_device *pdev = to_platform_device(dev); - struct sh_mobile_lcdc_priv *priv = platform_get_drvdata(pdev); + struct sh_mobile_lcdc_priv *priv = dev_get_drvdata(dev); /* turn off LCDC hardware */ lcdc_write(priv, _LDCNT1R, 0); @@ -2365,8 +2364,7 @@ static int sh_mobile_lcdc_runtime_suspend(struct device *dev) static int sh_mobile_lcdc_runtime_resume(struct device *dev) { - struct platform_device *pdev = to_platform_device(dev); - struct sh_mobile_lcdc_priv *priv = platform_get_drvdata(pdev); + struct sh_mobile_lcdc_priv *priv = dev_get_drvdata(dev); __sh_mobile_lcdc_start(priv); diff --git a/drivers/video/fbdev/sh_mobile_meram.c b/drivers/video/fbdev/sh_mobile_meram.c index baadfb207b2e..f5d8bd7ef509 100644 --- a/drivers/video/fbdev/sh_mobile_meram.c +++ b/drivers/video/fbdev/sh_mobile_meram.c @@ -572,8 +572,7 @@ EXPORT_SYMBOL_GPL(sh_mobile_meram_cache_update); #ifdef CONFIG_PM static int sh_mobile_meram_suspend(struct device *dev) { - struct platform_device *pdev = to_platform_device(dev); - struct sh_mobile_meram_priv *priv = platform_get_drvdata(pdev); + struct sh_mobile_meram_priv *priv = dev_get_drvdata(dev); unsigned int i, j; for (i = 0; i < MERAM_REGS_SIZE; i++) @@ -596,8 +595,7 @@ static int sh_mobile_meram_suspend(struct device *dev) static int sh_mobile_meram_resume(struct device *dev) { - struct platform_device *pdev = to_platform_device(dev); - struct sh_mobile_meram_priv *priv = platform_get_drvdata(pdev); + struct sh_mobile_meram_priv *priv = dev_get_drvdata(dev); unsigned int i, j; for (i = 0; i < 32; i++) {