From patchwork Wed Mar 28 01:24:48 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Emil Velikov X-Patchwork-Id: 10311975 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 D4B636037D for ; Wed, 28 Mar 2018 01:31:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D35A12915B for ; Wed, 28 Mar 2018 01:31:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C6A7529E59; Wed, 28 Mar 2018 01:31:00 +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=-4.1 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, T_DKIM_INVALID 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 3053F2915B for ; Wed, 28 Mar 2018 01:31:00 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 28B076E02A; Wed, 28 Mar 2018 01:30:58 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wr0-x241.google.com (mail-wr0-x241.google.com [IPv6:2a00:1450:400c:c0c::241]) by gabe.freedesktop.org (Postfix) with ESMTPS id 7F2C16E02A for ; Wed, 28 Mar 2018 01:30:56 +0000 (UTC) Received: by mail-wr0-x241.google.com with SMTP id l49so663029wrl.4 for ; Tue, 27 Mar 2018 18:30:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=kWHJGSPYAWBDy1GbjLezOK+LUn9ON4FqU8yY6Y+Ywno=; b=GEd83Cc8GLVZm3W84r0Y0ehm5RNu4TkT8UCXsompgWvNnzpRCdOUR45M8TlBKiEnCi UY7Y5SRB1qOteF4JAqGl9XeL9cq9SmRsZ69UC3VX8abNBEIgbSXEZ/L+BYNw79HrNNPm VgplDuPHGhL7zGH9bmphEV3SHq7bDCXb+HYKJT4f60GfmGMGU0RaXmqsty0HVn6lL+xL lBqLfQopT01vvOCf4adrx7JXz73nmwIGxgmTXdeNfbOR+lxVY17YaeXyUQNdtS+/QgYI k7j64DH3EiZm7unb5iXkl++k+7fTN9KZk+uKlmOPxhvseOcQQMoE/OMKh/y0I2xN5yuv K9ow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=kWHJGSPYAWBDy1GbjLezOK+LUn9ON4FqU8yY6Y+Ywno=; b=VZlQHkLvqLqR0WOC5VZh/KxIVwt/uRCX8hXkTv39auZQSijQxIzAVDPFVTXdS7khzr R5q5bmt2FWQfH/r69XEMRx07O6kKG9P0B/LW4qBgs9nxFGCBGV7hRp8zPBKEP/KdNunI 13Lj3ZIMUtg4WSYewjouDcC9uS53zqWXWu5JXphYEgtMWcUbmEKigbP4KwgXDF3bNZ/7 Qom2YA961bK3h8kIBLtYy/ct5w2hJNc+2Lq0fulSww/p3CRN21IfzqwChpi9kKNBrxDK CJqmlR4k1GhzKO1zU4yXMdty3t//APgnoVYjdS/gAc82RAA15A9tA+mSkhv2owZpqafq ozYQ== X-Gm-Message-State: AElRT7G2k5ja9YoZ/oWmDjacmiZFbDWUy+EB+Wxy2F07vsYJ8su4wYlq IhNeKLb3jw+Qp6N2gitMtfqRqQ== X-Google-Smtp-Source: AIpwx499aiEUdZTQWyLlUcKLPxamJ0nZsOXaUIRogut8m1357Ih4+fF/+VA66VvvyXb94ZYKdQbuCg== X-Received: by 10.223.157.194 with SMTP id q2mr1107749wre.125.1522200654801; Tue, 27 Mar 2018 18:30:54 -0700 (PDT) Received: from localhost.localdomain (cpc91192-cmbg18-2-0-cust374.5-4.cable.virginm.net. [80.6.113.119]) by smtp.gmail.com with ESMTPSA id m9sm2641005wrf.13.2018.03.27.18.30.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 27 Mar 2018 18:30:53 -0700 (PDT) From: Emil Velikov To: dri-devel@lists.freedesktop.org Subject: [PATCH 1/4] drm/vgem: Fix vgem_init to get drm device avaliable. Date: Wed, 28 Mar 2018 02:24:48 +0100 Message-Id: <20180328012451.31479-1-emil.l.velikov@gmail.com> X-Mailer: git-send-email 2.16.0 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: Daniel Vetter , emil.l.velikov@gmail.com MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Deepak Sharma Modify vgem_init to take platform dev as parent in drm_dev_init. This will make drm device available at "/sys/devices/platform/vgem" in x86 chromebook. Cc: Daniel Vetter Signed-off-by: Deepak Sharma Reviewed-by: Sean Paul Signed-off-by: Emil Velikov Reviewed-by: Daniel Vetter --- drivers/gpu/drm/vgem/vgem_drv.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/vgem/vgem_drv.c b/drivers/gpu/drm/vgem/vgem_drv.c index 2524ff116f00..636ce32fa945 100644 --- a/drivers/gpu/drm/vgem/vgem_drv.c +++ b/drivers/gpu/drm/vgem/vgem_drv.c @@ -472,31 +472,30 @@ static int __init vgem_init(void) if (!vgem_device) return -ENOMEM; - ret = drm_dev_init(&vgem_device->drm, &vgem_driver, NULL); - if (ret) - goto out_free; - vgem_device->platform = platform_device_register_simple("vgem", -1, NULL, 0); if (IS_ERR(vgem_device->platform)) { ret = PTR_ERR(vgem_device->platform); - goto out_fini; + goto out_free; } dma_coerce_mask_and_coherent(&vgem_device->platform->dev, DMA_BIT_MASK(64)); + ret = drm_dev_init(&vgem_device->drm, &vgem_driver, &vgem_device->platform->dev); + if (ret) + goto out_unregister; /* Final step: expose the device/driver to userspace */ ret = drm_dev_register(&vgem_device->drm, 0); if (ret) - goto out_unregister; + goto out_fini; return 0; -out_unregister: - platform_device_unregister(vgem_device->platform); out_fini: drm_dev_fini(&vgem_device->drm); +out_unregister: + platform_device_unregister(vgem_device->platform); out_free: kfree(vgem_device); return ret;