From patchwork Tue Jun 21 08:54:16 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 9189907 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 BA5AF6075A for ; Tue, 21 Jun 2016 08:54:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A98CF27F7F for ; Tue, 21 Jun 2016 08:54:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9E84827FA7; Tue, 21 Jun 2016 08:54:55 +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_SIGNED, RCVD_IN_DNSWL_MED, T_DKIM_INVALID autolearn=unavailable version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 40EDC27FA3 for ; Tue, 21 Jun 2016 08:54:55 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 1822A6E67C; Tue, 21 Jun 2016 08:54:40 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-lf0-x244.google.com (mail-lf0-x244.google.com [IPv6:2a00:1450:4010:c07::244]) by gabe.freedesktop.org (Postfix) with ESMTPS id 12E126E665 for ; Tue, 21 Jun 2016 08:54:36 +0000 (UTC) Received: by mail-lf0-x244.google.com with SMTP id l188so1981597lfe.0 for ; Tue, 21 Jun 2016 01:54:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=prWaaThWVjPlZJppaSJnHVMWxxTXScw5W77DM9gQJJI=; b=C8ulbnmbP9HcgynhcOLXNkEMc2KPn5Aa+It4KCXPFkh+COlqhGO3scoX7mpzbvawgC cmtXTihfdEnzXIw1VuaI3VBwfissQ7on/PksZvRCLBuRvkpuZbufJey+dos8wyWFJKBv sFe7slrwcZZ3j0xEag45E0NbYUqI6i+HOVKnE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=prWaaThWVjPlZJppaSJnHVMWxxTXScw5W77DM9gQJJI=; b=YQMirQo9baw87pD+5F/cVpy6wvfdh4pbWOufAUoVpjKhfwkevFKe9ULgQwK4vhhjab lIGG/Ib5nSIrkAUHDVhJPhLX4fl7Sckfe3XHGRYaODBUUtzu2zgihA2d3otRN9xVNHmc k5p3uNrNVXPh2f0QrYSTWXDd2aOodGq2UfHsUJb+R/Ibz4AeV14Ev/AYzcN/0GZJZEuH AWLlPdHA/d6FIruVMD5emjl/V9unYshHtYZkH/wBuzR/auxL22ojUt0XbGvRWuNxE7HQ Iy4noCEQRfIiuObc2oimsgFnEg6k5ISoXMo0QUDPFR5FMENCFT9yocHN6OFBK6Dys8F4 UFXg== X-Gm-Message-State: ALyK8tKC40xKvshvk29NPUZUjvbQJsXlyxOX2LX6YwLg9xVq1u9cj3f33rYZKLskcH5Vrw== X-Received: by 10.28.111.215 with SMTP id c84mr2073169wmi.21.1466499273339; Tue, 21 Jun 2016 01:54:33 -0700 (PDT) Received: from phenom.ffwll.local ([2a02:168:56b5:0:ac27:b86c:7764:9429]) by smtp.gmail.com with ESMTPSA id a129sm1906106wma.2.2016.06.21.01.54.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 21 Jun 2016 01:54:32 -0700 (PDT) From: Daniel Vetter To: DRI Development Date: Tue, 21 Jun 2016 10:54:16 +0200 Message-Id: <1466499262-18717-5-git-send-email-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1466499262-18717-1-git-send-email-daniel.vetter@ffwll.ch> References: <1466499262-18717-1-git-send-email-daniel.vetter@ffwll.ch> Cc: Daniel Vetter , Intel Graphics Development , Laurent Pinchart , Philipp Zabel , Daniel Vetter , Maxime Ripard Subject: [Intel-gfx] [PATCH 05/11] drm: Don't call drm_dev_set_unique from platform drivers X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Virus-Scanned: ClamAV using ClamSMTP Since commit e112e593b215c394c0303dbf0534db0928e87967 Author: Nicolas Iooss Date: Fri Dec 11 11:20:28 2015 +0100 drm: use dev_name as default unique name in drm_dev_alloc() we're using a reasonable default which should work for everyone. Only mtk, rcar-du and sun4i are affected, and as kms-only drivers without any rendering support no one should ever care about the unique name v2: Rebase on top of mediatek. Cc: Philipp Zabel Cc: Maxime Ripard Cc: Laurent Pinchart Cc: Emil Velikov Reviewed-by: Emil Velikov Reviewed-by: Laurent Pinchart Acked-by: Maxime Ripard Acked-by: Philipp Zabel Signed-off-by: Daniel Vetter --- drivers/gpu/drm/drm_drv.c | 35 +++++++++++----------------------- drivers/gpu/drm/mediatek/mtk_drm_drv.c | 2 -- drivers/gpu/drm/rcar-du/rcar_du_drv.c | 2 -- drivers/gpu/drm/sun4i/sun4i_drv.c | 4 ---- include/drm/drmP.h | 1 - 5 files changed, 11 insertions(+), 33 deletions(-) diff --git a/drivers/gpu/drm/drm_drv.c b/drivers/gpu/drm/drm_drv.c index 063ba6820411..12aea538d52f 100644 --- a/drivers/gpu/drm/drm_drv.c +++ b/drivers/gpu/drm/drm_drv.c @@ -298,10 +298,9 @@ void drm_minor_release(struct drm_minor *minor) * callbacks implemented by the driver. The driver then needs to initialize all * the various subsystems for the drm device like memory management, vblank * handling, modesetting support and intial output configuration plus obviously - * initialize all the corresponding hardware bits. An important part of this is - * also calling drm_dev_set_unique() to set the userspace-visible unique name of - * this device instance. Finally when everything is up and running and ready for - * userspace the device instance can be published using drm_dev_register(). + * initialize all the corresponding hardware bits. Finally when everything is up + * and running and ready for userspace the device instance can be published + * using drm_dev_register(). * * There is also deprecated support for initalizing device instances using * bus-specific helpers and the ->load() callback. But due to @@ -323,6 +322,14 @@ void drm_minor_release(struct drm_minor *minor) * dev_priv field of &drm_device. */ +static int drm_dev_set_unique(struct drm_device *dev, const char *name) +{ + kfree(dev->unique); + dev->unique = kstrdup(name, GFP_KERNEL); + + return dev->unique ? 0 : -ENOMEM; +} + /** * drm_put_dev - Unregister and release a DRM device * @dev: DRM device @@ -741,26 +748,6 @@ void drm_dev_unregister(struct drm_device *dev) } EXPORT_SYMBOL(drm_dev_unregister); -/** - * drm_dev_set_unique - Set the unique name of a DRM device - * @dev: device of which to set the unique name - * @name: unique name - * - * Sets the unique name of a DRM device using the specified string. Drivers - * can use this at driver probe time if the unique name of the devices they - * drive is static. - * - * Return: 0 on success or a negative error code on failure. - */ -int drm_dev_set_unique(struct drm_device *dev, const char *name) -{ - kfree(dev->unique); - dev->unique = kstrdup(name, GFP_KERNEL); - - return dev->unique ? 0 : -ENOMEM; -} -EXPORT_SYMBOL(drm_dev_set_unique); - /* * DRM Core * The DRM core module initializes all global DRM objects and makes them diff --git a/drivers/gpu/drm/mediatek/mtk_drm_drv.c b/drivers/gpu/drm/mediatek/mtk_drm_drv.c index c33bf98c5d5e..04e901a80234 100644 --- a/drivers/gpu/drm/mediatek/mtk_drm_drv.c +++ b/drivers/gpu/drm/mediatek/mtk_drm_drv.c @@ -280,8 +280,6 @@ static int mtk_drm_bind(struct device *dev) if (!drm) return -ENOMEM; - drm_dev_set_unique(drm, dev_name(dev)); - drm->dev_private = private; private->drm = drm; diff --git a/drivers/gpu/drm/rcar-du/rcar_du_drv.c b/drivers/gpu/drm/rcar-du/rcar_du_drv.c index 48ec4b6e8b26..8784208d8eed 100644 --- a/drivers/gpu/drm/rcar-du/rcar_du_drv.c +++ b/drivers/gpu/drm/rcar-du/rcar_du_drv.c @@ -320,8 +320,6 @@ static int rcar_du_probe(struct platform_device *pdev) if (!ddev) return -ENOMEM; - drm_dev_set_unique(ddev, dev_name(&pdev->dev)); - rcdu->ddev = ddev; ddev->dev_private = rcdu; diff --git a/drivers/gpu/drm/sun4i/sun4i_drv.c b/drivers/gpu/drm/sun4i/sun4i_drv.c index 68e9d85085fb..5c4b4ad17ad3 100644 --- a/drivers/gpu/drm/sun4i/sun4i_drv.c +++ b/drivers/gpu/drm/sun4i/sun4i_drv.c @@ -135,10 +135,6 @@ static int sun4i_drv_bind(struct device *dev) if (!drm) return -ENOMEM; - ret = drm_dev_set_unique(drm, dev_name(drm->dev)); - if (ret) - goto free_drm; - drv = devm_kzalloc(dev, sizeof(*drv), GFP_KERNEL); if (!drv) { ret = -ENOMEM; diff --git a/include/drm/drmP.h b/include/drm/drmP.h index 88f7b7e055f1..dd07dc552f28 100644 --- a/include/drm/drmP.h +++ b/include/drm/drmP.h @@ -1076,7 +1076,6 @@ void drm_dev_ref(struct drm_device *dev); void drm_dev_unref(struct drm_device *dev); int drm_dev_register(struct drm_device *dev, unsigned long flags); void drm_dev_unregister(struct drm_device *dev); -int drm_dev_set_unique(struct drm_device *dev, const char *name); struct drm_minor *drm_minor_acquire(unsigned int minor_id); void drm_minor_release(struct drm_minor *minor);