Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3623120imu; Mon, 28 Jan 2019 08:01:40 -0800 (PST) X-Google-Smtp-Source: ALg8bN6is7vuvVTPx2f4V3jqY0AN03DBJSVgSbe5k/c7udFLJSwoSUhf+pcEm5knk7frX+pLOM92 X-Received: by 2002:a62:81c1:: with SMTP id t184mr13109776pfd.40.1548691300373; Mon, 28 Jan 2019 08:01:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548691300; cv=none; d=google.com; s=arc-20160816; b=yi9TwCuaCAjSk6JhcUnDZrspQsRyqATI9sR6ttgyecKO1tsFs4eFxkaaEtltcx/UFs rrCmPvtEbAzSY9CDpF8M1BowEDjJ+jJQcyddILZi6RDEBe15bQ4AzZYHMC/jtuysGXhT HdJXtyoQzCfqKy8Jz8ewfCJpj9pOJZPNQDbnvfzEoSVrLTT0PPr+nalYcY0YmFal8Do0 usr4mEJTHTFgdvRgo5S2qR0E4Ec/RoIevjd2bjUMDtJJYrrOJP25z/qjuz9+J4O6sm/V iws0R8/bo+5HvUJtC7SokLLFuJuLXK42y4I+e+roZwfcEgbed/HF+94sv++SzEFE9y0H Naqw== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=PUuIow5mO6Ni7WTjqIuFRZ0ak3DIz29hFmZgYuVvygo=; b=SqHa9/gMbkZXenXVEC4w7rGDRY/+gwWZ5vlZe9hXJHXz464PLs82a7GGUQDsHl4GGN c/STVEPyCTCMoSdh4Hij4b3Be+ADIswzjXJBg0S8No2gRGaFjdWVZSCgMhUUCtx8eaiP I0lwVv7o+tSFkLZNEvA1aVKsRCIL874RoFjCLu1cbAEjHh+Wed0U7/cXZXk/pcOrnP05 S8BsGel4Rrp7e+QVuuGOYVw6vsKKr4EY+z7k4HpXfEoKbDgznFlrw5JQ9g8LMgXn0jHG amELaEGSBEyHgKLx+hoG55OKkV7JCQx5VokseTnl7++TLiED/WiUJZnp3zZ4Xh18HnKH 7dTg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Bk34DOeE; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l135si32649642pga.69.2019.01.28.08.01.25; Mon, 28 Jan 2019 08:01:40 -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=Bk34DOeE; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730585AbfA1P7i (ORCPT + 99 others); Mon, 28 Jan 2019 10:59:38 -0500 Received: from mail.kernel.org ([198.145.29.99]:44880 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728987AbfA1P7g (ORCPT ); Mon, 28 Jan 2019 10:59:36 -0500 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 1B5B921848; Mon, 28 Jan 2019 15:59:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1548691176; bh=qjkEd0R7IuLFs4bm2TXYBEjhSS1ckwJx6qRYyOhQ+Go=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Bk34DOeEfC1231s6SfelU6slhAKCX/hvj1KCbH0KKBNSR5T8hM6XM6T2wz0zBDyDt fNCSK8LLwid0rhJqK2PytbAm/40k4X1lELskXy+igwLLKcRYxHZbEtU1yIoVi0bGJ4 7t1IkFJRhvY9l8VF3VIxCMtRTLDA1OjvX8pO0UWs= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Deepak Sharma , Daniel Vetter , Emil Velikov , Sasha Levin , dri-devel@lists.freedesktop.org Subject: [PATCH AUTOSEL 4.19 003/258] drm/vgem: Fix vgem_init to get drm device available. Date: Mon, 28 Jan 2019 10:55:09 -0500 Message-Id: <20190128155924.51521-3-sashal@kernel.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190128155924.51521-1-sashal@kernel.org> References: <20190128155924.51521-1-sashal@kernel.org> MIME-Version: 1.0 X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Deepak Sharma [ 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 0e5620f76ee0..6887db878b38 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