From patchwork Wed Mar 28 01:24:51 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Emil Velikov X-Patchwork-Id: 10311981 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 7E1E460212 for ; Wed, 28 Mar 2018 01:31:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7F51B2918C for ; Wed, 28 Mar 2018 01:31:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 73F5129E61; Wed, 28 Mar 2018 01:31:12 +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_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, 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]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 011512918C for ; Wed, 28 Mar 2018 01:31:12 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 1454A6E187; Wed, 28 Mar 2018 01:31:10 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wm0-x243.google.com (mail-wm0-x243.google.com [IPv6:2a00:1450:400c:c09::243]) by gabe.freedesktop.org (Postfix) with ESMTPS id EBA1B89227 for ; Wed, 28 Mar 2018 01:30:59 +0000 (UTC) Received: by mail-wm0-x243.google.com with SMTP id f125so2059389wme.4 for ; Tue, 27 Mar 2018 18:30:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=GWY7YCM9qqU+o20ANFYm/UyAtHA8J1bnG2OFQIC0+MQ=; b=BPS7ydkXKsc5TBcoKA738emtj+QDfVNQF3Xul7HMRdSuEAat33YWbvYSpLoKfOD5eI p/JbqvOIbBBXGJ7rVwlO/wRBQWu9I/u83pg1EWSsg97BOIaFA5kk4/jYpNLdAbYNPTvL 5oU+Ls+OHQkCr6GwmXdiQ/ekN7BnGdM2w9mMi3Zu1UD0WUDBfZVzHwu8AHN4MJaz+FV8 J6qctkibaaZaFOLx5GNPEpkUXdbgSO29TOHpgeAzxaUmypR/q2qO/NGrNJVTdjW+oHpM b10kA1nkkdvCRP+BwDBRyLgGmQ3RmHCTOCU1/GVqpl0hXOZ1XK0yjUYaICRgDYc1BwB2 YpOA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=GWY7YCM9qqU+o20ANFYm/UyAtHA8J1bnG2OFQIC0+MQ=; b=qfJVZrddGsrvkyb8ZM281jBnuIIJ0f5V41UfcGdf7utfZU7dZyRzJRpmj1SywrBnvG UDVm7aHH9mbcXLeiCxAw9c8JArIGtElf2pJXYQ+FwCabTyZhT2PdGMDuJIo97FC71mvh qPAA/zT1vwZyL5sk/+fdGXkGwMZWQ/jBobGwCRGSYMFa89LJs7R6+sQ3zDDREp35NGa4 vesFByx4GD/upefs8vm0haYHr07BN5xNyZBZsNHqB/BZ4diUIIBVtB2c3zmAAZzKj441 +NPB4buRRMAWiQ8TAKM2xSe68sDUsMQPSCWxLFNgVU7uJmx73OclA6BpcBGixLFPbs6/ nYYw== X-Gm-Message-State: AElRT7EBuVxHSDeFWbKdRpLz3Xn9JUOyeixCeKHVM4IiBPcy6g5qdV2m QgjdA3Es17pjfFyd15W+LplNVQ== X-Google-Smtp-Source: AIpwx4/oFvN0gmFtWH9VBG8+dBjFkdwcJrvP0p9qgtGdVF6vj1yRVrCwErUwuDgr5ynbj6FDTiueuA== X-Received: by 10.28.30.85 with SMTP id e82mr953621wme.67.1522200658235; Tue, 27 Mar 2018 18:30:58 -0700 (PDT) Received: from localhost.localdomain (cpc91192-cmbg18-2-0-cust374.5-4.cable.virginm.net. [80.6.113.119]) by smtp.gmail.com with ESMTPSA id m9sm2641005wrf.13.2018.03.27.18.30.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 27 Mar 2018 18:30:57 -0700 (PDT) From: Emil Velikov To: dri-devel@lists.freedesktop.org Subject: [PATCH 4/4] drm: drm_dev_set_unique private, again Date: Wed, 28 Mar 2018 02:24:51 +0100 Message-Id: <20180328012451.31479-4-emil.l.velikov@gmail.com> X-Mailer: git-send-email 2.16.0 In-Reply-To: <20180328012451.31479-1-emil.l.velikov@gmail.com> References: <20180328012451.31479-1-emil.l.velikov@gmail.com> X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Daniel Vetter , emil.l.velikov@gmail.com MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Emil Velikov As of last commit we hide this from the drivers. Effectively reverts commit a6b5fac59cb216ac906f02300d3630c24520d9ef. Cc: Daniel Vetter Signed-off-by: Emil Velikov Reviewed-by: Daniel Vetter --- drivers/gpu/drm/drm_drv.c | 38 ++++++++++++++------------------------ include/drm/drm_drv.h | 3 --- 2 files changed, 14 insertions(+), 27 deletions(-) diff --git a/drivers/gpu/drm/drm_drv.c b/drivers/gpu/drm/drm_drv.c index 88da984ff9eb..26e360a0e50c 100644 --- a/drivers/gpu/drm/drm_drv.c +++ b/drivers/gpu/drm/drm_drv.c @@ -266,10 +266,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 &drm_driver.load callback. But due to @@ -290,6 +289,17 @@ void drm_minor_release(struct drm_minor *minor) * structure, which is supported through drm_dev_init(). */ +static int drm_dev_set_unique(struct drm_device *dev, const char *name) +{ + if (!name) + return -EINVAL; + + 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 @@ -840,26 +850,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/include/drm/drm_drv.h b/include/drm/drm_drv.h index d32b688eb346..3e6671fc9ced 100644 --- a/include/drm/drm_drv.h +++ b/include/drm/drm_drv.h @@ -642,7 +642,4 @@ static inline int drm_dev_is_unplugged(struct drm_device *dev) } -int drm_dev_set_unique(struct drm_device *dev, const char *name); - - #endif