Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp2678987imj; Mon, 11 Feb 2019 06:55:53 -0800 (PST) X-Google-Smtp-Source: AHgI3IbcahXnutgMDlz/Q3gl7bgdQCOlLEP/1d6twbWer+PwHQaKkg3w9VLY91poxmd+WU2pHHPZ X-Received: by 2002:a63:1013:: with SMTP id f19mr29231195pgl.38.1549896953500; Mon, 11 Feb 2019 06:55:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549896953; cv=none; d=google.com; s=arc-20160816; b=Sq72WfXQLcLcmL5y0oRfSUbrnNUr8ZYzW70szUZ0/re1efmT2VrC3vNwU7fU/vKHPb XN5DofjNbkBSETQGXsk9aAyDMsKKd+7TAXRdoLPsCTksIsfnOlQynA/x+vdmcUSkhjb3 YxJHuL64lirHEen2P2ayVIJXiwhl9LW2C6IdnnPjcTZRHHbh0gomDmqIbOkAn3QlTvUs 9i2KdajTl/XBHKxo8d34YCyeyOmXkYKeq1Mzsezjb8PhRfL+O3W56xyCcDikPYHI47U2 G8dA3g59bXwm4NL2ZXib8Kqs9u6loXtq8SK17XEvjNd/lJaHS3/4L8bF9BH8V/IbKn3d sXbg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=u4Kkvwyc4aYEpi/d2NKYmhSE+aqgpFrNxp80aV3nNvk=; b=XMKfv36lZUNesHrm7h3HzeCZquUQWQbkBy23OPP2YXEQL5Qe6SpiuF9DKYDxoGUcti uK46eabDesRYy6DvTcFbYGeaIxkldWpJ0C0Mo0JRlXlSgZkQAvCquSPj5nsBrGm7hjL2 6yY7mtKwxaoMzfYJTbxPXWFwKUHEKVurcnT6jSETq9SYGh06ew4ImsUXbpnc2jEdamG3 Vdf7MqhJ/ce/BS6uNpseWxKvDVk2n3J7a+Q58jQqZh5bbrHCHIufBmJAXZrtMHoU8hkW iCR3EHWXj0z47GLQ93xquCfK8zl1AQ1OX+gHhlqEid4Hlr2Ur59TXLrpevhe5w0U7dDc DDNQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=xiiRrbfa; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y27si9497495pgk.490.2019.02.11.06.55.37; Mon, 11 Feb 2019 06:55:53 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=xiiRrbfa; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388861AbfBKOyk (ORCPT + 99 others); Mon, 11 Feb 2019 09:54:40 -0500 Received: from mail.kernel.org ([198.145.29.99]:41392 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388223AbfBKOyh (ORCPT ); Mon, 11 Feb 2019 09:54:37 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 8C4BA222A1; Mon, 11 Feb 2019 14:54:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1549896877; bh=kAR3eazKGe/yltSyV1caCVb7AGSePrmZfyQuZyxLCnk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=xiiRrbfaqLGG0YOomSI9iflxnNoxHTy/biaJq/WlIZXVmFzqvnsCa9l5dEDCxSha1 SOuTjO/akk8ANusse5Pyb9n50yp2g6yolVKBKep0MMXeHvBAzfQjK1NFiRbr6A2XUk f1D6hhako2JBTloAYlBFTrsXfv/Df1E6fCdrBgBo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Daniel Vetter , Deepak Sharma , Sean Paul , Emil Velikov , Sasha Levin Subject: [PATCH 4.14 003/205] drm/vgem: Fix vgem_init to get drm device available. Date: Mon, 11 Feb 2019 15:16:41 +0100 Message-Id: <20190211141827.408084036@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190211141827.214852402@linuxfoundation.org> References: <20190211141827.214852402@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ [ Upstream commit d5c04dff24870ef07ce6453a3f4e1ffd9cf88d27 ] 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 Link: https://patchwork.freedesktop.org/patch/msgid/20181023163550.15211-1-emil.l.velikov@gmail.com Signed-off-by: Sasha Levin --- 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 2524ff116f00..81c7ab10c083 100644 --- a/drivers/gpu/drm/vgem/vgem_drv.c +++ b/drivers/gpu/drm/vgem/vgem_drv.c @@ -472,31 +472,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; -- 2.19.1