From patchwork Mon Apr 22 09:40:34 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Seung-Woo Kim X-Patchwork-Id: 2470761 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork1.kernel.org (Postfix) with ESMTP id A28A13FCA5 for ; Mon, 22 Apr 2013 09:41:10 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 853BAE6666 for ; Mon, 22 Apr 2013 02:41:09 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mailout4.samsung.com (mailout4.samsung.com [203.254.224.34]) by gabe.freedesktop.org (Postfix) with ESMTP id C97C6E6637 for ; Mon, 22 Apr 2013 02:40:35 -0700 (PDT) Received: from epcpsbgr2.samsung.com (u142.gpu120.samsung.co.kr [203.254.230.142]) by mailout4.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MLN00C9EHJLUND0@mailout4.samsung.com> for dri-devel@lists.freedesktop.org; Mon, 22 Apr 2013 18:40:33 +0900 (KST) Received: from epcpsbgm1.samsung.com ( [172.20.52.115]) by epcpsbgr2.samsung.com (EPCPMTA) with SMTP id 7C.9A.21454.19505715; Mon, 22 Apr 2013 18:40:33 +0900 (KST) X-AuditID: cbfee68e-b7f0d6d0000053ce-14-5175059161e4 Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id 32.83.10837.19505715; Mon, 22 Apr 2013 18:40:33 +0900 (KST) Received: from localhost.localdomain ([10.90.8.56]) by mmp1.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0MLN00HJGHJJDN20@mmp1.samsung.com>; Mon, 22 Apr 2013 18:40:33 +0900 (KST) From: Seung-Woo Kim To: dri-devel@lists.freedesktop.org, inki.dae@samsung.com Subject: [PATCH] exynos/drm: hdmi: cleanup for hdmi common device registration Date: Mon, 22 Apr 2013 18:40:34 +0900 Message-id: <1366623634-2420-1-git-send-email-sw0312.kim@samsung.com> X-Mailer: git-send-email 1.7.4.1 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrFLMWRmVeSWpSXmKPExsWyRsSkWHcia2mgwYI5+ha9504yWVz5+p7N YtL9CSwWZ5vesFvMmPySzYHVY/u3B6we97uPM3n0bVnFGMAcxWWTkpqTWZZapG+XwJUx+/RD 9oK3ghWbrx5nbWBcyN/FyMkhIWAicet+GzOELSZx4d56ti5GLg4hgaWMEt+/r2HqYuQAK2pc zQMRX8QosXPZHhYIp5lJYkr3fVaQbjYBHYn9S36D2SIClhIPtv4Gm8os4C7R/PIYWFxYwE+i 6d0BdhCbRUBVYtXa80wgNq+Aq0T3slusEFcoSCy495YNwn7OJjH/NhtEvYDEt8mHWCAOkpXY dADqaEmJgytusExgFFzAyLCKUTS1ILmgOCm9yEivODG3uDQvXS85P3cTIzAcT/971reD8eYB 60OMyUDjJjJLiSbnA8M5ryTe0NjMyMLUxNTYyNzSjDRhJXFetRbrQCGB9MSS1OzU1ILUovii 0pzU4kOMTBycUg2MtnXVN7tnzP40Ze5s/tUWvbrVdVN3Wd6/IvZy9fdk+/121gK6c40zT7/a 9KszKGXdPB2RS05eGr/UBG5cjPwqo3uItavts9WD+/IcxdWtXlNDJu+bZv3wyTmnupVb43vd tI47ccYrRZxQOs3j26q57w7fz3N7ttbM6i27fc54djH3oea/jnk5SizFGYmGWsxFxYkAf6k1 TV0CAAA= X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrBIsWRmVeSWpSXmKPExsVy+t9jAd2JrKWBBssbNSx6z51ksrjy9T2b xaT7E1gszja9YbeYMfklmwOrx/ZvD1g97ncfZ/Lo27KKMYA5qoHRJiM1MSW1SCE1Lzk/JTMv 3VbJOzjeOd7UzMBQ19DSwlxJIS8xN9VWycUnQNctMwdoqZJCWWJOKVAoILG4WEnfDtOE0BA3 XQuYxghd35AguB4jAzSQsIYxY/bph+wFbwUrNl89ztrAuJC/i5GDQ0LARKJxNU8XIyeQKSZx 4d56ti5GLg4hgUWMEjuX7WGBcJqZJKZ032cFqWIT0JHYv+Q3mC0iYCnxYOtvZhCbWcBdovnl MbC4sICfRNO7A+wgNouAqsSqteeZQGxeAVeJ7mW3WCG2KUgsuPeWbQIj9wJGhlWMoqkFyQXF Sem5hnrFibnFpXnpesn5uZsYweH+TGoH48oGi0OMAhyMSjy8E7pLAoVYE8uKK3MPMUpwMCuJ 8N59DRTiTUmsrEotyo8vKs1JLT7EmAy0fSKzlGhyPjAW80riDY1NzIwsjcwNLYyMzUkTVhLn PdBqHSgkkJ5YkpqdmlqQWgSzhYmDU6qBkUVq7RsHl+pnphYvXr1f8LPXM7dDTXrS/xtBP584 VdT45Z8WYJ6y1lP0wvVjorVZJ9vvm37bcmhTX/yR6Ttvlqm/Da5IjLJ5JBF954Vszu+e3peN WtEuG5OY6g9q/LjHx5lrtqW25R/n2d31+jJVkVuey3x79zPlcep62w1X/+/ia17ke8ejXIml OCPRUIu5qDgRAI24+x+7AgAA DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected Cc: kyungmin.park@samsung.com, sw0312.kim@samsung.com X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Errors-To: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org The hdmi common device registration function does not need extern definition and for error case and unregister case, exynos_drm_hdmi_pdev should be cleared. Signed-off-by: Seung-Woo Kim --- This commit is based on exynos-drm-next and my previous commit "drm/exynos: fix wrong return check for platform_register_simple". Link: http://www.mail-archive.com/dri-devel@lists.freedesktop.org/msg37144.html drivers/gpu/drm/exynos/exynos_drm_drv.h | 2 +- drivers/gpu/drm/exynos/exynos_drm_hdmi.c | 14 ++++++++++---- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.h b/drivers/gpu/drm/exynos/exynos_drm_drv.h index 4606fac..635d4c5 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_drv.h +++ b/drivers/gpu/drm/exynos/exynos_drm_drv.h @@ -322,7 +322,7 @@ void exynos_drm_subdrv_close(struct drm_device *dev, struct drm_file *file); * this function registers exynos drm hdmi platform device. It ensures only one * instance of the device is created. */ -extern int exynos_platform_device_hdmi_register(void); +int exynos_platform_device_hdmi_register(void); /* * this function unregisters exynos drm hdmi platform device if it exists. diff --git a/drivers/gpu/drm/exynos/exynos_drm_hdmi.c b/drivers/gpu/drm/exynos/exynos_drm_hdmi.c index 6986a1b..ba2f0f1 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_hdmi.c +++ b/drivers/gpu/drm/exynos/exynos_drm_hdmi.c @@ -51,21 +51,27 @@ struct drm_hdmi_context { int exynos_platform_device_hdmi_register(void) { + struct platform_device *pdev; + if (exynos_drm_hdmi_pdev) return -EEXIST; - exynos_drm_hdmi_pdev = platform_device_register_simple( + pdev = platform_device_register_simple( "exynos-drm-hdmi", -1, NULL, 0); - if (IS_ERR(exynos_drm_hdmi_pdev)) - return PTR_ERR(exynos_drm_hdmi_pdev); + if (IS_ERR(pdev)) + return PTR_ERR(pdev); + + exynos_drm_hdmi_pdev = pdev; return 0; } void exynos_platform_device_hdmi_unregister(void) { - if (exynos_drm_hdmi_pdev) + if (exynos_drm_hdmi_pdev) { platform_device_unregister(exynos_drm_hdmi_pdev); + exynos_drm_hdmi_pdev = NULL; + } } void exynos_hdmi_drv_attach(struct exynos_drm_hdmi_context *ctx)