Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp2647486imj; Mon, 11 Feb 2019 06:26:02 -0800 (PST) X-Google-Smtp-Source: AHgI3IbI3JxQilKwylCvHt4PVkXqYyccL5s2BRcIujSXTYTnx3etlHXjWgttIrtaXJf51F1j7Ac+ X-Received: by 2002:a63:cc4e:: with SMTP id q14mr33459230pgi.291.1549895162609; Mon, 11 Feb 2019 06:26:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549895162; cv=none; d=google.com; s=arc-20160816; b=fiBUz+WnzYnljNUKeeM3QWrZehX35FM4S/itOEtdNpALYpSFafehhVTCeJHprHaMwd ZCdsGtJZYdjk446eUSoyf2kyiksyqVajpI9FO0pNeGsLxSQzjrlxZIPujii1d+cg90ij fO1CZgnE0C7IsOxVK51gvlKRO/ORk/mkG0hX34/l9Cc7mBLdDvokEs1KdZZPmdcEi0eg kNEzxTTJ9p+hi7jqid9g75qY9+U/nsNNxJ1uq+hZORfnJlDApDclUH815ptOo6Ysp+pQ efJRfgIw2eclzMpYIME0KWwWRjkVP0lGHMm3wE8KBmEJrMmWokxVk47NLl4uJdCPIvXO Soug== 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=7BkFNw5jlIoIVDpN802D2ZGYWmwaGl/nvCOr2E3X0q4=; b=ZcSpFQIGefKdxo8P2tLCcr94hPvkSZxO6Foh68q2m4aqFLqD1Uau8ZRBtj3JJq7DLm Zz6M5SFvFkhGUJHDcWPXvjKBkIfenRFAPMNcQ5ZBma0gN1RCif6HjbADkhjs+NMfVpJ3 qNhW9LAPy4z7rtjXD13ZNATeXmh1SxmT5XRRd4Zpb6nHDKcHDBOFMpur3sJWps02XQIN MZ45dmNsHys9vaB+gDtCvkXKWYKvql1fCcyNvQm3RZFqwUobnohcEvssg2fQkWJXfgRR ArwnYQBF0QspioY/pYzjsuwWVX0mNLC1U0yVZ3UW9mDXsYimZMkdvKV1TI7fN4jTqjn6 GpUA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=oY521As6; 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 a6si1228995pff.199.2019.02.11.06.25.46; Mon, 11 Feb 2019 06:26:02 -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=oY521As6; 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 S1728444AbfBKOVD (ORCPT + 99 others); Mon, 11 Feb 2019 09:21:03 -0500 Received: from mail.kernel.org ([198.145.29.99]:53802 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728389AbfBKOVB (ORCPT ); Mon, 11 Feb 2019 09:21:01 -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 0171A2073F; Mon, 11 Feb 2019 14:20:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1549894860; bh=kS3XJ9se4IjeX7P+syNaFpmpj6AtaHgO0KH1P7StpTk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=oY521As6xjr6LSYl6hIdgGAM7Yk8eXaoSIQ8gvEAlGX2rr9WUhWd2Kq+cXOyL7rq2 BuIqIhP29mwGp2Gp+Pkm/wr8fPvoyZNaozHbEZLA7He5syOBJvv9wfTrCnCV1iBA0I xEXn10SkcD1XJmSUMgHdEyIfvP7fJH3g+/8J4UXY= 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.20 004/352] drm/vgem: Fix vgem_init to get drm device available. Date: Mon, 11 Feb 2019 15:13:51 +0100 Message-Id: <20190211141846.783223749@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190211141846.543045703@linuxfoundation.org> References: <20190211141846.543045703@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.20-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 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; -- 2.19.1