All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel.vetter@ffwll.ch>
To: DRI Development <dri-devel@lists.freedesktop.org>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>,
	Intel Graphics Development <intel-gfx@lists.freedesktop.org>,
	Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	Philipp Zabel <p.zabel@pengutronix.de>,
	Daniel Vetter <daniel.vetter@intel.com>,
	Maxime Ripard <maxime.ripard@free-electrons.com>
Subject: [PATCH 10/16] drm: Don't call drm_dev_set_unique from platform drivers
Date: Fri, 17 Jun 2016 09:33:28 +0200	[thread overview]
Message-ID: <1466148814-8194-11-git-send-email-daniel.vetter@ffwll.ch> (raw)
In-Reply-To: <1466148814-8194-1-git-send-email-daniel.vetter@ffwll.ch>

Since

commit e112e593b215c394c0303dbf0534db0928e87967
Author: Nicolas Iooss <nicolas.iooss_linux@m4x.org>
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 <p.zabel@pengutronix.de>
Cc: Maxime Ripard <maxime.ripard@free-electrons.com>
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: Emil Velikov <emil.l.velikov@gmail.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
---
 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 ecba2511ef5a..25f10586a74d 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
@@ -697,26 +704,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 62e0e70cb5a2..bd40d7ee5ec5 100644
--- a/include/drm/drmP.h
+++ b/include/drm/drmP.h
@@ -1073,7 +1073,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);
-- 
2.8.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  parent reply	other threads:[~2016-06-17  7:33 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-17  7:33 [PATCH 00/16] More drm master and SET_UNIQUE cleanups Daniel Vetter
2016-06-17  7:33 ` [PATCH 01/16] drm: Only do the hw.lock cleanup in master_relase for !MODESET Daniel Vetter
2016-06-17  7:33 ` [PATCH 02/16] drm: Move authmagic cleanup into drm_master_release Daniel Vetter
2016-06-17  7:33 ` [PATCH 03/16] drm: Protect authmagic with master_mutex Daniel Vetter
2016-06-17  7:33 ` [PATCH 04/16] drm: Mark authmagic ioctls as unlocked Daniel Vetter
2016-06-17  7:33 ` [PATCH 05/16] drm: Mark set/drop master ioctl " Daniel Vetter
2016-06-17  7:33 ` [PATCH 06/16] drm: Move master pointer from drm_minor to drm_device Daniel Vetter
2016-06-17  7:51   ` Chris Wilson
2016-06-17  7:33 ` [PATCH 07/16] drm: Clean up drm_crtc.h Daniel Vetter
2016-06-17  7:53   ` [Intel-gfx] " Chris Wilson
2016-06-20 20:18     ` Daniel Vetter
2016-06-17  7:33 ` [PATCH 08/16] drm: Use dev->name as fallback for dev->unique Daniel Vetter
2016-06-17 22:25   ` Emil Velikov
2016-06-17  7:33 ` [PATCH 09/16] drm/vgem: Stop calling drm_drv_set_unique Daniel Vetter
2016-06-20 11:42   ` Chris Wilson
2016-06-20 12:51     ` Daniel Vetter
2016-06-17  7:33 ` Daniel Vetter [this message]
2016-06-17 11:12   ` [PATCH 10/16] drm: Don't call drm_dev_set_unique from platform drivers Laurent Pinchart
2016-06-19 19:44     ` Maxime Ripard
2016-06-20 12:03   ` Philipp Zabel
2016-06-17  7:33 ` [PATCH 11/16] drm: Nuke SET_UNIQUE ioctl Daniel Vetter
2016-06-17 22:35   ` Emil Velikov
2016-06-17  7:33 ` [PATCH 12/16] drm: Lobotomize set_busid nonsense for !pci drivers Daniel Vetter
2016-06-20 14:27   ` Emil Velikov
2016-06-17  7:33 ` [PATCH 13/16] drm: Refactor drop/set master code a bit Daniel Vetter
2016-06-17  7:55   ` Chris Wilson
2016-06-17 23:00   ` Emil Velikov
2016-06-17 23:47     ` Emil Velikov
2016-06-20 21:07       ` Daniel Vetter
2016-06-17  7:33 ` [PATCH 14/16] drm: Extract drm_is_current_master Daniel Vetter
2016-06-17  7:57   ` Chris Wilson
2016-06-17  7:33 ` [PATCH 15/16] drm: Clear up master tracking booleans Daniel Vetter
2016-06-17  7:57   ` Chris Wilson
2016-06-17 23:25   ` Emil Velikov
2016-06-17  7:33 ` [PATCH 16/16] drm: document drm_auth.c Daniel Vetter
2016-06-17  7:59   ` Chris Wilson
2016-06-17 23:46   ` Emil Velikov
2016-06-20 21:17     ` Daniel Vetter
2016-06-20 22:36       ` Emil Velikov
2016-06-17  8:23 ` ✗ Ro.CI.BAT: failure for More drm master and SET_UNIQUE cleanups Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1466148814-8194-11-git-send-email-daniel.vetter@ffwll.ch \
    --to=daniel.vetter@ffwll.ch \
    --cc=daniel.vetter@intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=maxime.ripard@free-electrons.com \
    --cc=p.zabel@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.