From patchwork Fri Jun 17 07:33:28 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 9182739 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 200B06075D for ; Fri, 17 Jun 2016 07:33:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 104A928396 for ; Fri, 17 Jun 2016 07:33:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 05333283A7; Fri, 17 Jun 2016 07:33:59 +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=ham 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 4635F28396 for ; Fri, 17 Jun 2016 07:33:58 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6572F6E2AF; Fri, 17 Jun 2016 07:33:57 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-wm0-x242.google.com (mail-wm0-x242.google.com [IPv6:2a00:1450:400c:c09::242]) by gabe.freedesktop.org (Postfix) with ESMTPS id 16A2B6E02D for ; Fri, 17 Jun 2016 07:33:55 +0000 (UTC) Received: by mail-wm0-x242.google.com with SMTP id r201so2346555wme.0 for ; Fri, 17 Jun 2016 00:33:55 -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=oBzhSfcNQqn/U/pwTvbNN/V+WK0F7zvPMbhjeeA+dyo=; b=f0VjKTSoXCOWPkDFmUdRcBVohMX9oA90X00XTe6v26Up09dn08EGM001369KwezTd2 ziIPLyPg5wdJnn7hmvKycTTuxHyUhAmvpTQd1+aZoWC1hhX7N2WfPTNj9WHMW5yrpwTe LMgyBGSORgzowVtJniZQxZSohZ+D1Suf7rL8w= 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=oBzhSfcNQqn/U/pwTvbNN/V+WK0F7zvPMbhjeeA+dyo=; b=TcZbnZj15VZcFEO24+gcueVrV3ZJPSjkGEeDeeveoV2+Jf2hnaLnzUtOuIu+bTH7Z4 jwVlPPip1AYTGCNJ0n85Oq6tl4sX6hY3gSoGYZkVSLteGL5RhsTw0c1hMPcYujr6pVm1 yOE0cJlMtJn5khdYFfC1fJqsRrhhilanTMdAJ6EfSLAUuNZDbmMPoXr9B4X9bRw6I9YX zBqKs0sNkv/omO254c9cK1nw4S7vkkPZQWt5pap8t90/Kc/y4y/B20HZoWoklMsXPhKJ jlYOlDpmOBmbzY0OdTzTC9mn2dbgS0yAVwHaOYM1+cy46sgP46GNzv119XsRV3BsjW+Z h/WQ== X-Gm-Message-State: ALyK8tLqyBGHhOlvwlSaQ8o5YmNuyzZBYDSJd5Wpc+Qr5WL4cCZoy+jdjclBXHpfC9Vwzw== X-Received: by 10.28.189.130 with SMTP id n124mr19789843wmf.76.1466148833015; Fri, 17 Jun 2016 00:33:53 -0700 (PDT) Received: from phenom.ffwll.local ([2a02:168:56b5:0:ac27:b86c:7764:9429]) by smtp.gmail.com with ESMTPSA id s67sm1475049wmf.3.2016.06.17.00.33.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 17 Jun 2016 00:33:52 -0700 (PDT) From: Daniel Vetter To: DRI Development Date: Fri, 17 Jun 2016 09:33:28 +0200 Message-Id: <1466148814-8194-11-git-send-email-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1466148814-8194-1-git-send-email-daniel.vetter@ffwll.ch> References: <1466148814-8194-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 10/16] 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 Signed-off-by: Daniel Vetter Reviewed-by: Laurent Pinchart Acked-by: Maxime Ripard Acked-by: Philipp Zabel --- 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);