From patchwork Tue Oct 16 07:21:25 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jingoo Han X-Patchwork-Id: 1599031 Return-Path: X-Original-To: patchwork-linux-fbdev@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id E6E85DFFED for ; Tue, 16 Oct 2012 07:21:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754603Ab2JPHV2 (ORCPT ); Tue, 16 Oct 2012 03:21:28 -0400 Received: from mailout3.samsung.com ([203.254.224.33]:23249 "EHLO mailout3.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754244Ab2JPHV1 (ORCPT ); Tue, 16 Oct 2012 03:21:27 -0400 Received: from epcpsbgm1.samsung.com (epcpsbgm1 [203.254.230.26]) by mailout3.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MBZ0018B5R76DN0@mailout3.samsung.com> for linux-fbdev@vger.kernel.org; Tue, 16 Oct 2012 16:21:25 +0900 (KST) X-AuditID: cbfee61a-b7f976d000001eb9-a2-507d0af5c7eb Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id 70.55.07865.5FA0D705; Tue, 16 Oct 2012 16:21:25 +0900 (KST) Received: from DOJG1HAN02 ([12.23.120.99]) by mmp1.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0MBZ00MYY5RPXB30@mmp1.samsung.com> for linux-fbdev@vger.kernel.org; Tue, 16 Oct 2012 16:21:25 +0900 (KST) From: Jingoo Han To: 'Florian Tobias Schandinat' Cc: linux-fbdev@vger.kernel.org, 'Jingoo Han' Subject: [PATCH] video: s3c-fb: use dev_get_drvdata() instead of platform_get_drvdata() Date: Tue, 16 Oct 2012 16:21:25 +0900 Message-id: <006f01cdab6e$d9fd70b0$8df85210$%han@samsung.com> MIME-version: 1.0 Content-type: text/plain; charset=us-ascii Content-transfer-encoding: 7bit X-Mailer: Microsoft Office Outlook 12.0 Thread-index: Ac2rbtbGOpyT0xlTSM61crg8/brw7g== Content-language: ko x-cr-hashedpuzzle: BMNj EKnN Ew+g G2/2 JG76 LWIy Opvl PKm9 PNeE PhRf V0ZZ ZIK+ b7kt ceUQ dyF8 gwMP; 3; ZgBsAG8AcgBpAGEAbgBzAGMAaABhAG4AZABpAG4AYQB0AEAAZwBtAHgALgBkAGUAOwBqAGcAMQAuAGgAYQBuAEAAcwBhAG0AcwB1AG4AZwAuAGMAbwBtADsAbABpAG4AdQB4AC0AZgBiAGQAZQB2AEAAdgBnAGUAcgAuAGsAZQByAG4AZQBsAC4AbwByAGcA; Sosha1_v1; 7; {C576E95B-310D-485A-ADCD-67A297270DE7}; agBnADEALgBoAGEAbgBAAHMAYQBtAHMAdQBuAGcALgBjAG8AbQA=; Tue, 16 Oct 2012 07:21:20 GMT; WwBQAEEAVABDAEgAXQAgAHYAaQBkAGUAbwA6ACAAcwAzAGMALQBmAGIAOgAgAHUAcwBlACAAZABlAHYAXwBnAGUAdABfAGQAcgB2AGQAYQB0AGEAKAApACAAaQBuAHMAdABlAGEAZAAgAG8AZgAgAHAAbABhAHQAZgBvAHIAbQBfAGcAZQB0AF8AZAByAHYAZABhAHQAYQAoACkA x-cr-puzzleid: {C576E95B-310D-485A-ADCD-67A297270DE7} X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrDLMWRmVeSWpSXmKPExsVy+t9jAd2vXLUBBl/X6luc6PvA6sDo8XmT XABjFJdNSmpOZllqkb5dAlfGuffbGAseClZMWrKJuYHxJV8XIyeHhICJRNfD9ewQtpjEhXvr 2boYuTiEBBYxSrS8XccK4cxikjh98jQjSBWbgJrEly+HgTo4OEQErCQ2bdUECTMLOEtMuHGC DcQWFoiUOPqilwnEZhFQlVjY0wvWyitgK3Fu6gsmCFtQ4sfkeywQvVoS63ceZ4Kw5SU2r3nL DDJeQkBd4tFfXZCwiICexO7G6+wQJSIS+168YwQ5TUKghVViZ/drqHpTiWUn9SYwCs1CsmEW kg2zkGyYhWTUAkaWVYyiqQXJBcVJ6bmGesWJucWleel6yfm5mxjBYfxMagfjygaLQ4wCHIxK PLwZzjUBQqyJZcWVuYcYJTiYlUR4PSYChXhTEiurUovy44tKc1KLDzFKc7AoifM2e6QECAmk J5akZqemFqQWwWSZODilGhhZlzDYGhRV+xwL5/zNXbB2ym3F/pygtwc9b/5YtqVglbSA4jMR Dl/zX1wJD/uuWmnuPFn3zoxZ+9kj52ALzuuBU/K//+32YqiU7tfuEit5I7F4wrH1hmtarUPC joWHP18hek7sau6E6r4nhXp836e9tjiz2v/k5/cRvkEGh1/P3mC4uEmv95YSS3FGoqEWc1Fx IgBscRElXwIAAA== Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org Because there is no need to access to the platform device in suspend/resume and runtime_suspend/resume, dev_get_drvdata() can be used instead of platform_get_drvdata() to make the code smaller. Signed-off-by: Jingoo Han --- drivers/video/s3c-fb.c | 14 +++++--------- 1 files changed, 5 insertions(+), 9 deletions(-) diff --git a/drivers/video/s3c-fb.c b/drivers/video/s3c-fb.c index 2ed7b63..95c6e30 100644 --- a/drivers/video/s3c-fb.c +++ b/drivers/video/s3c-fb.c @@ -1544,8 +1544,7 @@ static int __devexit s3c_fb_remove(struct platform_device *pdev) #ifdef CONFIG_PM_SLEEP static int s3c_fb_suspend(struct device *dev) { - struct platform_device *pdev = to_platform_device(dev); - struct s3c_fb *sfb = platform_get_drvdata(pdev); + struct s3c_fb *sfb = dev_get_drvdata(dev); struct s3c_fb_win *win; int win_no; @@ -1572,8 +1571,7 @@ static int s3c_fb_suspend(struct device *dev) static int s3c_fb_resume(struct device *dev) { - struct platform_device *pdev = to_platform_device(dev); - struct s3c_fb *sfb = platform_get_drvdata(pdev); + struct s3c_fb *sfb = dev_get_drvdata(dev); struct s3c_fb_platdata *pd = sfb->pdata; struct s3c_fb_win *win; int win_no; @@ -1623,7 +1621,7 @@ static int s3c_fb_resume(struct device *dev) if (!win) continue; - dev_dbg(&pdev->dev, "resuming window %d\n", win_no); + dev_dbg(dev, "resuming window %d\n", win_no); s3c_fb_set_par(win->fbinfo); } @@ -1636,8 +1634,7 @@ static int s3c_fb_resume(struct device *dev) #ifdef CONFIG_PM_RUNTIME static int s3c_fb_runtime_suspend(struct device *dev) { - struct platform_device *pdev = to_platform_device(dev); - struct s3c_fb *sfb = platform_get_drvdata(pdev); + struct s3c_fb *sfb = dev_get_drvdata(dev); if (!sfb->variant.has_clksel) clk_disable_unprepare(sfb->lcd_clk); @@ -1649,8 +1646,7 @@ static int s3c_fb_runtime_suspend(struct device *dev) static int s3c_fb_runtime_resume(struct device *dev) { - struct platform_device *pdev = to_platform_device(dev); - struct s3c_fb *sfb = platform_get_drvdata(pdev); + struct s3c_fb *sfb = dev_get_drvdata(dev); struct s3c_fb_platdata *pd = sfb->pdata; clk_prepare_enable(sfb->bus_clk);