From patchwork Tue Oct 23 16:35: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: 10653431 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 DB17913A9 for ; Tue, 23 Oct 2018 16:36:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C8FF42A022 for ; Tue, 23 Oct 2018 16:36:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BA6522A093; Tue, 23 Oct 2018 16:36:56 +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,DKIM_ADSP_CUSTOM_MED, FREEMAIL_FROM,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 3CA002A022 for ; Tue, 23 Oct 2018 16:36:56 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5602F6E1E1; Tue, 23 Oct 2018 16:36:55 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wr1-x443.google.com (mail-wr1-x443.google.com [IPv6:2a00:1450:4864:20::443]) by gabe.freedesktop.org (Postfix) with ESMTPS id C258C6E1E1 for ; Tue, 23 Oct 2018 16:36:53 +0000 (UTC) Received: by mail-wr1-x443.google.com with SMTP id r10-v6so1544881wrv.6 for ; Tue, 23 Oct 2018 09:36:53 -0700 (PDT) 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:mime-version :content-transfer-encoding; bh=NS2RuACUdH0+aqxyXDrXj5nzkviHFSP97IM4/E0Mq+4=; b=m5WN1jGBwcB/t3j2AAz1T8plJL2svTpASmpfkZ/zo/M0CUR/QktOgFR+h5PFLh5Ywl JZnE0mm4dYYdNIzSRpxtVaHwX4SDx065rw6s8gTfpqO79XCKI8BUFhSPMLGvw4Wx/c8P 5DufKMp8IWP3BdwsDLZ9HmNFbbrWHUb8nGvumHJpUgCShaT83H/k5xe2JrqaX1r1H1tI u4i8QfrMIuaEEYlfhj8dbsCiDpOkVVL+nLzIWapYUY1mIzdx4VCW/n4hDiC+ujk6V9+l fmz1I3w7x+IPdd7PMCJiPiXbSxYAPWxtpa1ZRyRyx2RMWLGtlsvLoi4SW9Qt/HDMPFqy oo6Q== X-Gm-Message-State: ABuFfoh0sj6cdBk5f3OQKwUTEffhAMWUkg8lnenjbj5A5CfZsefA/nvF CK7OxXb39u4HShmG9/yB4fv4zj9c X-Google-Smtp-Source: ACcGV62M4eM3lr/+PQgjWASyD03qOq7gCAC1cMsDag9WL6ZiJBmgRpiMyvtui5p/ICsPK7ZB8rxOhg== X-Received: by 2002:a5d:628c:: with SMTP id k12-v6mr48724622wru.83.1540312612173; Tue, 23 Oct 2018 09:36:52 -0700 (PDT) Received: from arch-x1c3.cbg.collabora.co.uk ([2a00:5f00:102:0:9665:9cff:feee:aa4d]) by smtp.gmail.com with ESMTPSA id q77-v6sm3246732wmd.33.2018.10.23.09.36.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 23 Oct 2018 09:36:50 -0700 (PDT) From: Emil Velikov To: dri-devel@lists.freedesktop.org Subject: [PATCH 1/3] drm/vgem: Fix vgem_init to get drm device available. Date: Tue, 23 Oct 2018 17:35:48 +0100 Message-Id: <20181023163550.15211-1-emil.l.velikov@gmail.com> X-Mailer: git-send-email 2.19.1 MIME-Version: 1.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 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. v2: rebase, address checkpatch typo and line over 80 characters 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 | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/vgem/vgem_drv.c b/drivers/gpu/drm/vgem/vgem_drv.c index ec6af8b920da..f1f7ab9dcdbf 100644 --- a/drivers/gpu/drm/vgem/vgem_drv.c +++ b/drivers/gpu/drm/vgem/vgem_drv.c @@ -471,31 +471,31 @@ 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;