From patchwork Mon Apr 15 23:44:06 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Inki Dae X-Patchwork-Id: 10901715 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 39C1214DB for ; Mon, 15 Apr 2019 23:43:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 24FEC286B9 for ; Mon, 15 Apr 2019 23:43:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 19EE1287AF; Mon, 15 Apr 2019 23:43:58 +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=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 9FEA0286B9 for ; Mon, 15 Apr 2019 23:43:57 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5EB5F894C3; Mon, 15 Apr 2019 23:43:55 +0000 (UTC) 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 ESMTPS id 28AC78946E for ; Mon, 15 Apr 2019 23:43:52 +0000 (UTC) Received: from epcas1p2.samsung.com (unknown [182.195.41.46]) by mailout4.samsung.com (KnoxPortal) with ESMTP id 20190415234350epoutp04b15b5aa5743ac38ee7b09816a252a0c9~VynBZKyOR0792107921epoutp04V for ; Mon, 15 Apr 2019 23:43:50 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout4.samsung.com 20190415234350epoutp04b15b5aa5743ac38ee7b09816a252a0c9~VynBZKyOR0792107921epoutp04V Received: from epsmges1p1.samsung.com (unknown [182.195.40.154]) by epcas1p3.samsung.com (KnoxPortal) with ESMTP id 20190415234345epcas1p34118b0b55ef11024d7a5d60c33ff9728~Vym8wGrud2750027500epcas1p33; Mon, 15 Apr 2019 23:43:45 +0000 (GMT) Received: from epcas1p4.samsung.com ( [182.195.41.48]) by epsmges1p1.samsung.com (Symantec Messaging Gateway) with SMTP id BC.62.04139.03715BC5; Tue, 16 Apr 2019 08:43:44 +0900 (KST) Received: from epsmtrp2.samsung.com (unknown [182.195.40.14]) by epcas1p1.samsung.com (KnoxPortal) with ESMTPA id 20190415234344epcas1p1792072e2298c6f59de9c0614403533ff~Vym77D1-S3228332283epcas1p1-; Mon, 15 Apr 2019 23:43:44 +0000 (GMT) Received: from epsmgms1p1new.samsung.com (unknown [182.195.42.41]) by epsmtrp2.samsung.com (KnoxPortal) with ESMTP id 20190415234344epsmtrp2ff0ff909948e68d44c1fb6ebac062d4f~Vym76dlzb1366813668epsmtrp2P; Mon, 15 Apr 2019 23:43:44 +0000 (GMT) X-AuditID: b6c32a35-98bff7000000102b-2b-5cb51730a078 Received: from epsmtip1.samsung.com ( [182.195.34.30]) by epsmgms1p1new.samsung.com (Symantec Messaging Gateway) with SMTP id C4.D8.03692.03715BC5; Tue, 16 Apr 2019 08:43:44 +0900 (KST) Received: from localhost.localdomain (unknown [10.113.221.211]) by epsmtip1.samsung.com (KnoxPortal) with ESMTPA id 20190415234344epsmtip1a28357f74d06e2ea34488735d8379813~Vym7w-PzB2260822608epsmtip1N; Mon, 15 Apr 2019 23:43:44 +0000 (GMT) From: Inki Dae To: dri-devel@lists.freedesktop.org Subject: [PATCH 5/6] drm/exynos: vidi: replace platform_device pointer with device one Date: Tue, 16 Apr 2019 08:44:06 +0900 Message-Id: <1555371847-25253-6-git-send-email-inki.dae@samsung.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1555371847-25253-1-git-send-email-inki.dae@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrNKsWRmVeSWpSXmKPExsWy7bCmga6B+NYYg6NT1CyufH3PZjHp/gQW ixnn9zE5MHvc7z7O5NG3ZRWjx+dNcgHMUdk2GamJKalFCql5yfkpmXnptkrewfHO8aZmBoa6 hpYW5koKeYm5qbZKLj4Bum6ZOUCLlBTKEnNKgUIBicXFSvp2NkX5pSWpChn5xSW2SqkFKTkF lgV6xYm5xaV56XrJ+blWhgYGRqZAhQnZGZd3LGAq6FCpWDhnD3MD42rZLkZODgkBE4kzU78y djFycQgJ7GCUeDFjI5TziVFi06dn7CBVQgLfGCWu9LvCdCx+cgeqaC+jxPn72xkhir4wSjw/ rAtiswmoSkxccZ8NxBYRUJb4O3EVWA2zgJvE4tPLWUBsYYEIiWWL/rCC2CxA9WsOvQer4RVw kbgy+yMrxDI5iZvnOplBbE4BV4meC7PYIOIfWSWmnFCGsF0kWi9MYISwhSVeHd/CDmFLSXx+ txeqvlzi2btnQHs5gOwaiW9zKyBMY4mLK1JATGYBTYn1u/QhjuSTePe1hxWigleio00IYoaS xLGLN6D2SEhcWDIRaraHxLdD26ABMoNRYu76y8wTGGVnIUxdwMi4ilEstaA4Nz212LDAEDmG NjGCE46W6Q7GKed8DjEKcDAq8fBy9GyJEWJNLCuuzD3EKMHBrCTC65gCFOJNSaysSi3Kjy8q zUktPsRoCgy6icxSosn5wGSYVxJvaGpkbGxsYWJoZmpoqCTOu97BOUZIID2xJDU7NbUgtQim j4mDU6qBMXyLq5ff4qauWr5V5wu6b+30qVS7Pb2/LoXZ8nHO/NMPC76ZLcw5eMpV4eM+HsWm 7dMYtiWaLH97/4PU7Ik1u5zmVsTufLbSai/n79OFNTM/HjPawCpmb3bm/CYXpkDj5pZ6WUuT RazFiwtfif8Wm7v6zUcmS3/m4ACXr1rTVx1ZdbpkAY/vAyWW4oxEQy3mouJEAFDIhKROAwAA X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFmpiluLIzCtJLcpLzFFi42LZdlhJTtdAfGuMwb3b/BZXvr5ns5h0fwKL xYzz+5gcmD3udx9n8ujbsorR4/MmuQDmKC6blNSczLLUIn27BK6MyzsWMBV0qFQsnLOHuYFx tWwXIyeHhICJxOIndxhBbCGB3YwSy+fkdzFyAMUlJLZs5YAwhSUOHy7uYuQCqvjEKDGl8xBY OZuAqsTEFffZQGwRAWWJvxNXgcWZBTwkTr36yQxiCwuESfx48ZIVxGYBql9z6D1YDa+Ai8SV 2R9ZIU6Qk7h5rhOsnlPAVaLnwiw2kL1CQDWTpytOYORbwMiwilEytaA4Nz232LDAMC+1XK84 Mbe4NC9dLzk/dxMjOGS0NHcwXl4Sf4hRgINRiYc3oW9LjBBrYllxZe4hRgkOZiURXscUoBBv SmJlVWpRfnxRaU5q8SFGaQ4WJXHep3nHIoUE0hNLUrNTUwtSi2CyTBycUg2MTd8vin0r/ytg yxR3dqrn+9XqN12em83d/1No+V+dhD+WSw+8/cN/5/Gu7TIudTVfZ3GYln5q2rby2ZfvkrcU /A5MM77gZtlQxP1/wSLG7UYWu9f2rO99eWeRy+EnM4IuXWdc5/9Hqd0o/SbjCxtGoa+9fCtM py18eejE9U/Pubk/Tij4mH+Wa4oSS3FGoqEWc1FxIgB46emBFQIAAA== X-CMS-MailID: 20190415234344epcas1p1792072e2298c6f59de9c0614403533ff X-Msg-Generator: CA CMS-TYPE: 101P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20190415234344epcas1p1792072e2298c6f59de9c0614403533ff References: <1555371847-25253-1-git-send-email-inki.dae@samsung.com> X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1555371830; bh=6qAwyhVT2KX8YU7xk7Ev9L3dxwds10JLtDUgGbnno98=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cK21L7vpeTwq6lsKJsndn8M+oviqAZSOTHeM+DmQg9/EKxFO3jZePu0yUyF8/lCC3 DrpACHMWjUN6JQEb/gHwPHs2FrYD+cAyrHtflHvfDiFznjtuA0MLfSqJBkXntHqQv2 YhZBivGGrGNWXSloFOyBbQR/j5ChnNFl9TC5Uazo= X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-samsung-soc@vger.kernel.org MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP Add device pointer to vidi_context and remove platform_device pointer. It doesn't need for vidi_context to contain platform_device object. Instead, this patch makes this driver more simply by replacing platform_device pointer with device one. Signed-off-by: Inki Dae --- drivers/gpu/drm/exynos/exynos_drm_vidi.c | 33 ++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_vidi.c b/drivers/gpu/drm/exynos/exynos_drm_vidi.c index 08e610c..44bcb2d 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_vidi.c +++ b/drivers/gpu/drm/exynos/exynos_drm_vidi.c @@ -40,8 +40,8 @@ struct vidi_context { struct drm_encoder encoder; - struct platform_device *pdev; struct drm_device *drm_dev; + struct device *dev; struct exynos_drm_crtc *crtc; struct drm_connector connector; struct exynos_drm_plane planes[WINDOWS_NR]; @@ -123,7 +123,7 @@ static void vidi_update_plane(struct exynos_drm_crtc *crtc, return; addr = exynos_drm_fb_dma_addr(state->fb, 0); - DRM_DEV_DEBUG_KMS(&ctx->pdev->dev, "dma_addr = %pad\n", &addr); + DRM_DEV_DEBUG_KMS(ctx->dev, "dma_addr = %pad\n", &addr); } static void vidi_enable(struct exynos_drm_crtc *crtc) @@ -226,19 +226,19 @@ int vidi_connection_ioctl(struct drm_device *drm_dev, void *data, struct drm_exynos_vidi_connection *vidi = data; if (!vidi) { - DRM_DEV_DEBUG_KMS(&ctx->pdev->dev, + DRM_DEV_DEBUG_KMS(ctx->dev, "user data for vidi is null.\n"); return -EINVAL; } if (vidi->connection > 1) { - DRM_DEV_DEBUG_KMS(&ctx->pdev->dev, + DRM_DEV_DEBUG_KMS(ctx->dev, "connection should be 0 or 1.\n"); return -EINVAL; } if (ctx->connected == vidi->connection) { - DRM_DEV_DEBUG_KMS(&ctx->pdev->dev, + DRM_DEV_DEBUG_KMS(ctx->dev, "same connection request.\n"); return -EINVAL; } @@ -248,13 +248,13 @@ int vidi_connection_ioctl(struct drm_device *drm_dev, void *data, raw_edid = (struct edid *)(unsigned long)vidi->edid; if (!drm_edid_is_valid(raw_edid)) { - DRM_DEV_DEBUG_KMS(&ctx->pdev->dev, + DRM_DEV_DEBUG_KMS(ctx->dev, "edid data is invalid.\n"); return -EINVAL; } ctx->raw_edid = drm_edid_duplicate(raw_edid); if (!ctx->raw_edid) { - DRM_DEV_DEBUG_KMS(&ctx->pdev->dev, + DRM_DEV_DEBUG_KMS(ctx->dev, "failed to allocate raw_edid.\n"); return -ENOMEM; } @@ -313,14 +313,14 @@ static int vidi_get_modes(struct drm_connector *connector) * to ctx->raw_edid through specific ioctl. */ if (!ctx->raw_edid) { - DRM_DEV_DEBUG_KMS(&ctx->pdev->dev, "raw_edid is null.\n"); + DRM_DEV_DEBUG_KMS(ctx->dev, "raw_edid is null.\n"); return -EFAULT; } edid_len = (1 + ctx->raw_edid->extensions) * EDID_LENGTH; edid = kmemdup(ctx->raw_edid, edid_len, GFP_KERNEL); if (!edid) { - DRM_DEV_DEBUG_KMS(&ctx->pdev->dev, "failed to allocate edid\n"); + DRM_DEV_DEBUG_KMS(ctx->dev, "failed to allocate edid\n"); return -ENOMEM; } @@ -344,7 +344,7 @@ static int vidi_create_connector(struct drm_encoder *encoder) ret = drm_connector_init(ctx->drm_dev, connector, &vidi_connector_funcs, DRM_MODE_CONNECTOR_VIRTUAL); if (ret) { - DRM_DEV_ERROR(ctx->drm_dev->dev, + DRM_DEV_ERROR(ctx->dev, "Failed to initialize connector with drm\n"); return ret; } @@ -448,13 +448,14 @@ static const struct component_ops vidi_component_ops = { static int vidi_probe(struct platform_device *pdev) { struct vidi_context *ctx; + struct device *dev = &pdev->dev; int ret; - ctx = devm_kzalloc(&pdev->dev, sizeof(*ctx), GFP_KERNEL); + ctx = devm_kzalloc(dev, sizeof(*ctx), GFP_KERNEL); if (!ctx) return -ENOMEM; - ctx->pdev = pdev; + ctx->dev = dev; timer_setup(&ctx->timer, vidi_fake_vblank_timer, 0); @@ -462,21 +463,21 @@ static int vidi_probe(struct platform_device *pdev) platform_set_drvdata(pdev, ctx); - ret = device_create_file(&pdev->dev, &dev_attr_connection); + ret = device_create_file(dev, &dev_attr_connection); if (ret < 0) { - DRM_DEV_ERROR(&pdev->dev, + DRM_DEV_ERROR(dev, "failed to create connection sysfs.\n"); return ret; } - ret = component_add(&pdev->dev, &vidi_component_ops); + ret = component_add(dev, &vidi_component_ops); if (ret) goto err_remove_file; return ret; err_remove_file: - device_remove_file(&pdev->dev, &dev_attr_connection); + device_remove_file(dev, &dev_attr_connection); return ret; }