From patchwork Mon Apr 15 08:54:15 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Inki Dae X-Patchwork-Id: 10900337 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 4578E17E1 for ; Mon, 15 Apr 2019 08:54:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 30CD3288AE for ; Mon, 15 Apr 2019 08:54:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 251F1288C4; Mon, 15 Apr 2019 08:54:14 +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 B05D8288AE for ; Mon, 15 Apr 2019 08:54:13 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B33A3892FE; Mon, 15 Apr 2019 08:54:08 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mailout2.samsung.com (mailout2.samsung.com [203.254.224.25]) by gabe.freedesktop.org (Postfix) with ESMTPS id EF6F4892EF for ; Mon, 15 Apr 2019 08:54:06 +0000 (UTC) Received: from epcas1p4.samsung.com (unknown [182.195.41.48]) by mailout2.samsung.com (KnoxPortal) with ESMTP id 20190415085405epoutp02ca94058324d9c97eaf91483af8f4c9ec~VmeK-73zk0984209842epoutp02j for ; Mon, 15 Apr 2019 08:54:05 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.samsung.com 20190415085405epoutp02ca94058324d9c97eaf91483af8f4c9ec~VmeK-73zk0984209842epoutp02j Received: from epsmges1p3.samsung.com (unknown [182.195.40.154]) by epcas1p3.samsung.com (KnoxPortal) with ESMTP id 20190415085401epcas1p3c01d92242318decddfc79de642253b28~VmeHnDmiS1630116301epcas1p3W; Mon, 15 Apr 2019 08:54:01 +0000 (GMT) Received: from epcas1p4.samsung.com ( [182.195.41.48]) by epsmges1p3.samsung.com (Symantec Messaging Gateway) with SMTP id A6.F1.04143.3A644BC5; Mon, 15 Apr 2019 17:53:55 +0900 (KST) Received: from epsmtrp1.samsung.com (unknown [182.195.40.13]) by epcas1p1.samsung.com (KnoxPortal) with ESMTPA id 20190415085355epcas1p1e434f9c755b5c524c4f760028d820554~VmeBZBtmZ2450524505epcas1p1f; Mon, 15 Apr 2019 08:53:55 +0000 (GMT) Received: from epsmgms1p2new.samsung.com (unknown [182.195.42.42]) by epsmtrp1.samsung.com (KnoxPortal) with ESMTP id 20190415085355epsmtrp1dc4e8f4a3e81e7111709569d4e4a8606~VmeBYaryX0451304513epsmtrp1K; Mon, 15 Apr 2019 08:53:55 +0000 (GMT) X-AuditID: b6c32a37-f19ff7000000102f-67-5cb446a3f46d Received: from epsmtip2.samsung.com ( [182.195.34.31]) by epsmgms1p2new.samsung.com (Symantec Messaging Gateway) with SMTP id 7D.29.03662.3A644BC5; Mon, 15 Apr 2019 17:53:55 +0900 (KST) Received: from localhost.localdomain (unknown [10.113.221.211]) by epsmtip2.samsung.com (KnoxPortal) with ESMTPA id 20190415085355epsmtip28b9786c8b10977ecff8706bfd8b16044~VmeBSQe2m0338403384epsmtip2m; Mon, 15 Apr 2019 08:53:55 +0000 (GMT) From: Inki Dae To: dri-devel@lists.freedesktop.org Subject: [PATCH 6/7] drm/vidi: replace platform_device pointer with device one Date: Mon, 15 Apr 2019 17:54:15 +0900 Message-Id: <1555318456-23397-7-git-send-email-inki.dae@samsung.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1555318456-23397-1-git-send-email-inki.dae@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrDKsWRmVeSWpSXmKPExsWy7bCmge5ity0xBpf2i1tc+fqezWLS/Qks FjPO72NyYPa4332cyaNvyypGj8+b5AKYo7JtMlITU1KLFFLzkvNTMvPSbZW8g+Od403NDAx1 DS0tzJUU8hJzU22VXHwCdN0yc4AWKSmUJeaUAoUCEouLlfTtbIryS0tSFTLyi0tslVILUnIK LAv0ihNzi0vz0vWS83OtDA0MjEyBChOyMy7vWMBU0KFSsXDOHuYGxtWyXYycHBICJhKnZjxi ArGFBHYwSkzttYawPzFKrD0p2sXIBWR/Y5SYeekxM0zDkzd3GCESexklbh34wgbhfGGUuLCh gRGkik1AVWLiivtsILaIgLLE34mrwOLMAm4Si08vZwGxhQUCJE6cfgUWZwGqv/2mDSzOK+Ai sWDXd6htchI3z3WC2ZwCrhK3mpvANksIvGWV2DlrKSNEkYtEx6W77BC2sMSr41ugbCmJl/1t UHa5xLN3z4AWcADZNRLf5lZAmMYSF1ekgJjMApoS63fpQ1zJJ/Huaw8rRAWvREebEMQMJYlj F29A7ZSQuLBkIhuE7SFxceF1JkgozGCUuPSohX0Co+wshKkLGBlXMYqlFhTnpqcWGxYYI0fR JkZwytEy38G44ZzPIUYBDkYlHt4LlZtjhFgTy4orcw8xSnAwK4nwCnQAhXhTEiurUovy44tK c1KLDzGaAsNuIrOUaHI+MB3mlcQbmhoZGxtbmBiamRoaKonzrndwjhESSE8sSc1OTS1ILYLp Y+LglGpgtCu5nrfUMGP+gp/FbB9tGuYrH67cqHGf13Dtmtssgo9sMhfs2SjlYSS5P7/ay/5J 7z5bZnH9CYFnbrkFbY/xbVi2fIH3+npmQVf/86f+Z79+MdXoAztX9kqZm2vFy6+en3Ss71r7 rBhWiSC3LTe3Pai6VTJpXVrpbHOnLYJ7fv/ore1Y7PzorRJLcUaioRZzUXEiALTqEWVPAwAA X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFmphluLIzCtJLcpLzFFi42LZdlhJXnex25YYg3+dHBZXvr5ns5h0fwKL xYzz+5gcmD3udx9n8ujbsorR4/MmuQDmKC6blNSczLLUIn27BK6MyzsWMBV0qFQsnLOHuYFx tWwXIyeHhICJxJM3dxi7GLk4hAR2M0rcv7eBtYuRAyghIbFlKweEKSxx+HAxRMknRom/E/rZ QHrZBFQlJq64D2aLCChL/J24ihHEZhbwkDj16icziC0s4Cex8c55sBoWoPrbb9pYQGxeAReJ Bbu+M0PcICdx81wnmM0p4Cpxq7kJbI4QUM2KxolsExj5FjAyrGKUTC0ozk3PLTYsMMpLLdcr TswtLs1L10vOz93ECA4bLa0djCdOxB9iFOBgVOLhvVC5OUaINbGsuDL3EKMEB7OSCK9AB1CI NyWxsiq1KD++qDQntfgQozQHi5I4r3z+sUghgfTEktTs1NSC1CKYLBMHp1QDY07SMqnqv1z+ NVytL1LeXgtZrNXFu0L+78HJ/cxZefaiP3KLXNYHruv4/FDqvoYb9zv7WXx5j5pVtPXniYpt C1lYfqWHK8b0cGXNl8oa3k08/5S3xFZqCi3vCt77La31fJv3TqfZma2SnVZ/8iY82PlSW109 UM2JsWTyg5ezjxYv/F47yU9NiaU4I9FQi7moOBEA6vzQrxcCAAA= X-CMS-MailID: 20190415085355epcas1p1e434f9c755b5c524c4f760028d820554 X-Msg-Generator: CA CMS-TYPE: 101P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20190415085355epcas1p1e434f9c755b5c524c4f760028d820554 References: <1555318456-23397-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=1555318445; bh=6qAwyhVT2KX8YU7xk7Ev9L3dxwds10JLtDUgGbnno98=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=T2vb1gpm0PSFMiqyAgNilnsALSptE9Dr5oLasvTKGAvhQ4OIdfUKsmtmwa8VwCrfN WdStGbBzGkKEGtWQDW2h8P8P3kMkgYR99Ao8VmytjnxxwlHhc9AgSgNgjpsK3m+/NQ Ni1AUUBHRNSUCVC1GQSmc/myNGXpzyNPAWxKk3V0= 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; }