From patchwork Wed Jul 13 16:39:07 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Wilson X-Patchwork-Id: 9227987 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 BD92260868 for ; Wed, 13 Jul 2016 16:39:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AF1CE25227 for ; Wed, 13 Jul 2016 16:39:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A3CF2275A2; Wed, 13 Jul 2016 16:39:27 +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 575C625227 for ; Wed, 13 Jul 2016 16:39:27 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 14E326E790; Wed, 13 Jul 2016 16:39:25 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@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 654AC6E118 for ; Wed, 13 Jul 2016 16:39:18 +0000 (UTC) Received: by mail-wm0-x242.google.com with SMTP id o80so6493475wme.0 for ; Wed, 13 Jul 2016 09:39:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=Km4jJacOYjjvSACXHGZORh7DGTKcJLHCtxuN4IsIGnU=; b=aD1p5716hJo09QFU8ltRcz2kfcYhmu9x11p7A2h2iY8XI2H442iNDf7CmDBipOWvS7 H7dhdiAksJrEplttgU5H6fu+UKqscHLZJdoatUW7oztuq9Tze9mezf7g6Gi4FaZz1Gx4 RIDsYTHs9XcrF7Rz2XYLrb2xvseIsoQAiU7PzxIO/vNI6nhcDQ+TghPAfOziiNqJlbk+ U7c0QNzjXWHlsxRRocdr/qNrl1byu9UuwovMR3smmOs69joNioXIupOAxvyJjgQfT6fF juMCjiPu1Y6aIHew5/rfaVopPgagmDe2q3Mp0fKC83m38ZTgsUEEHVwRAHdqtdhWHzsp T1+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=Km4jJacOYjjvSACXHGZORh7DGTKcJLHCtxuN4IsIGnU=; b=Gct+n0BZXfy+5yNPNYXLSPoP4bNdL4OIZ3ERIEpIFS8m20FlpE17+DT1UbmA0E9y+b QTshrwkiOe4xh5Uzb4Uu79xsta2txCBLfp4s23uSTcZfzzSFx3MjOK252wtE28ewqisj XohCHgoNOlWHN/GYRgScU6I1g5kH49HyGt+Cqthe46w3lW5WWvAnUo2LtF4an1+moLoj gq9TLwOhfLrN0VoKzK8lSyD80ijFPFLcJuFhvzpTO2JmBZv6e4KmxNVhdSooISncV7cU ObeATZwIIK3h0E24dG6RWGWBJuoVDBN+KXVzudOxOU3ykPn3CW/+Cw8vhhI0d5HyIYWE j0eQ== X-Gm-Message-State: ALyK8tIjHMG/KlSkKet42rKwKPEAs4IxmtROcpt8gvE54pPqIxosQMADFagHIUYXqznRpA== X-Received: by 10.194.10.66 with SMTP id g2mr1753538wjb.7.1468427956559; Wed, 13 Jul 2016 09:39:16 -0700 (PDT) Received: from haswell.alporthouse.com ([78.156.65.138]) by smtp.gmail.com with ESMTPSA id x62sm1574207wmf.13.2016.07.13.09.39.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 13 Jul 2016 09:39:15 -0700 (PDT) From: Chris Wilson To: dri-devel@lists.freedesktop.org Subject: [PATCH 2/2] drm: Unexport drm_connector_unregister_all() Date: Wed, 13 Jul 2016 17:39:07 +0100 Message-Id: <1468427947-28037-2-git-send-email-chris@chris-wilson.co.uk> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1468427947-28037-1-git-send-email-chris@chris-wilson.co.uk> References: <1468427947-28037-1-git-send-email-chris@chris-wilson.co.uk> Cc: Daniel Vetter X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP This has now been removed from all drivers as it is performed centrally as a part of device unregistration for modesetting drivers. With the last user gone, we can unexport it from the DRM module. That requires us to move the code slightly to avoid the need for a forward declaration. Signed-off-by: Chris Wilson Cc: David Airlie Cc: Daniel Vetter Cc: dri-devel@lists.freedesktop.org Reviewed-by: Sean Paul --- drivers/gpu/drm/drm_crtc.c | 29 +++++++++-------------------- include/drm/drm_crtc.h | 3 --- 2 files changed, 9 insertions(+), 23 deletions(-) diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c index c85963f4f1dc..f65b75949c20 100644 --- a/drivers/gpu/drm/drm_crtc.c +++ b/drivers/gpu/drm/drm_crtc.c @@ -1115,6 +1115,15 @@ void drm_connector_unregister(struct drm_connector *connector) } EXPORT_SYMBOL(drm_connector_unregister); +static void drm_connector_unregister_all(struct drm_device *dev) +{ + struct drm_connector *connector; + + /* FIXME: taking the mode config mutex ends up in a clash with sysfs */ + list_for_each_entry(connector, &dev->mode_config.connector_list, head) + drm_connector_unregister(connector); +} + static int drm_connector_register_all(struct drm_device *dev) { struct drm_connector *connector; @@ -1138,26 +1147,6 @@ err: return ret; } -/** - * drm_connector_unregister_all - unregister connector userspace interfaces - * @dev: drm device - * - * This functions unregisters all connectors from sysfs and other places so - * that userspace can no longer access them. Drivers should call this as the - * first step tearing down the device instace, or when the underlying - * physical device disappeared (e.g. USB unplug), right before calling - * drm_dev_unregister(). - */ -void drm_connector_unregister_all(struct drm_device *dev) -{ - struct drm_connector *connector; - - /* FIXME: taking the mode config mutex ends up in a clash with sysfs */ - list_for_each_entry(connector, &dev->mode_config.connector_list, head) - drm_connector_unregister(connector); -} -EXPORT_SYMBOL(drm_connector_unregister_all); - static int drm_encoder_register_all(struct drm_device *dev) { struct drm_encoder *encoder; diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h index ddaa7243af55..b1e72322ebd6 100644 --- a/include/drm/drm_crtc.h +++ b/include/drm/drm_crtc.h @@ -2588,9 +2588,6 @@ static inline unsigned drm_connector_index(struct drm_connector *connector) return connector->connector_id; } -/* helpers to {un}register all connectors from sysfs for device */ -extern void drm_connector_unregister_all(struct drm_device *dev); - extern __printf(5, 6) int drm_encoder_init(struct drm_device *dev, struct drm_encoder *encoder,