Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp2078386rwl; Mon, 26 Dec 2022 08:34:12 -0800 (PST) X-Google-Smtp-Source: AMrXdXvcYpZIrNH6ltgluUIPQP+c90gW0qhK5b2QwN3YJZHEnr8lOtPD5yaKHJ23rdR5SkCRRHaW X-Received: by 2002:aa7:dcc9:0:b0:472:1436:73ab with SMTP id w9-20020aa7dcc9000000b00472143673abmr15291862edu.28.1672072452019; Mon, 26 Dec 2022 08:34:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672072452; cv=none; d=google.com; s=arc-20160816; b=fEzHgzlrzyAHNdRYUXOCTb0RKdsWmSB7YrOR9x/Vzrj9NyVGuNSBlFzaKkm21gpzwo tTK5jbQ6B+tOa1nCJ0ofEAC0uBUq7WI26upg75bYRSDQnJuGmEAawDH915y8QTDzTeDU lLVHntLo4037SH8jnkUxQqFmh1dOgMGiIwrjhYfjdOvyORsP4MLGjqEZu8P2m6zHtcuU wuy6F8uG76viuKnLi2pmFqd1lt20A082Q6nZiXnZV2sVtz7jc6nN1puo4PtfclOa+cCd FEencJ1F/HI5veLXGLmIjIyIbX+/sam4JkRGO+TR1kd57nfdYhyzcRQ7EKgi4qb6U/lk AKTw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=OXbSziPUtP0NBz3Ri+ufOZyM1ccFIFns/4pM3n5+BoA=; b=htV26UZDkn65eY/XFuOy9cCuRriu3j3po5wYC8YaiI/17yo6aNLaOaO8DKZG1kEgdT t8UJJQixSSdVckNjZxyw9YzDORQLG7b56VAwl1MzPx/tQEPnN9BSINGKouRso29QorOe WJteuD/Dc8cOGZlUxtqJ4HBT6afpEAtBHMs5tXOvTmZNOGUkP4pWMvzp6qsx1o+LVAvi Wi4GE05cRWpRHyA03Bvjjt0c6+oOobjr6va8smzuC4LeF40y0T7FlUaADHsZoauFo+iC 063znctGcwInRtT3qVL9a29kXrYez/Har0Awg0XkFZnSsNW8ZnkE6QVqVFRi3oWBZJy2 er5Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@igalia.com header.s=20170329 header.b="sH/9P5+Q"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p19-20020a056402155300b00482e80ee6dfsi5781316edx.54.2022.12.26.08.33.56; Mon, 26 Dec 2022 08:34:12 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=fail header.i=@igalia.com header.s=20170329 header.b="sH/9P5+Q"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232130AbiLZPv7 (ORCPT + 66 others); Mon, 26 Dec 2022 10:51:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38778 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232128AbiLZPv4 (ORCPT ); Mon, 26 Dec 2022 10:51:56 -0500 Received: from fanzine2.igalia.com (fanzine2.igalia.com [213.97.179.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6657126DD for ; Mon, 26 Dec 2022 07:51:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=igalia.com; s=20170329; h=Content-Transfer-Encoding:Content-Type:MIME-Version:References: In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=OXbSziPUtP0NBz3Ri+ufOZyM1ccFIFns/4pM3n5+BoA=; b=sH/9P5+QlsEJ0PJH2fS/fN+z3L yswK1yklIoI7QvSv2JHFUpMjquDkVvKdnX3tw2B5MpDi2SZnKy4vQdxDReNBi2BgRvTQJC17gMiLk uV+bF5wvKfJOH2qYMj+1JdYn7OYCzWuZ65/Fk9ctaYDooydC7XcWoG1gMBU5733479MLRmiXsUzex kctrDwPy8nefJhsDbtcX+alG1Kjc6rMX+UlMsN6mHFaS+8xMuQSqCruBplhvxJ1Wf4pXmuO5oUwPp Pu701BuJOrURY5nGiYyc1E27otqa+9Y+o0wLEVOW5n5yQRERV65GUGM6JiYJdrWxYaGgqlgvDyMKN gglfZREw==; Received: from [187.36.234.139] (helo=bowie..) by fanzine2.igalia.com with esmtpsa (Cipher TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim) id 1p9plX-00AXBr-Vp; Mon, 26 Dec 2022 16:51:52 +0100 From: =?UTF-8?q?Ma=C3=ADra=20Canal?= To: David Airlie , Daniel Vetter , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Cc: Melissa Wen , =?UTF-8?q?Andr=C3=A9=20Almeida?= , Lucas Stach , Russell King , Christian Gmeiner , etnaviv@lists.freedesktop.org, noralf@tronnes.org, Liviu Dudau , Brian Starkey , Emma Anholt , Alexey Brodkin , David Airlie , Gerd Hoffmann , Gurchetan Singh , Chia-I Wu , Tomi Valkeinen , =?UTF-8?q?Ma=C3=ADra=20Canal?= Subject: [PATCH 2/9] drm/gud: use new debugfs device-centered functions Date: Mon, 26 Dec 2022 12:50:22 -0300 Message-Id: <20221226155029.244355-3-mcanal@igalia.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221226155029.244355-1-mcanal@igalia.com> References: <20221226155029.244355-1-mcanal@igalia.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Replace the use of drm_debugfs_create_files() with the new drm_debugfs_add_file() function, which center the debugfs files management on the drm_device instead of drm_minor. Moreover, remove the debugfs_init hook and add the debugfs files directly on gud_probe(), before drm_dev_register(). Signed-off-by: MaĆ­ra Canal --- drivers/gpu/drm/gud/gud_drv.c | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/drivers/gpu/drm/gud/gud_drv.c b/drivers/gpu/drm/gud/gud_drv.c index 5aac7cda0505..9d7bf8ee45f1 100644 --- a/drivers/gpu/drm/gud/gud_drv.c +++ b/drivers/gpu/drm/gud/gud_drv.c @@ -325,8 +325,8 @@ static struct drm_gem_object *gud_gem_prime_import(struct drm_device *drm, struc static int gud_stats_debugfs(struct seq_file *m, void *data) { - struct drm_info_node *node = m->private; - struct gud_device *gdrm = to_gud_device(node->minor->dev); + struct drm_debugfs_entry *entry = m->private; + struct gud_device *gdrm = to_gud_device(entry->dev); char buf[10]; string_get_size(gdrm->bulk_len, 1, STRING_UNITS_2, buf, sizeof(buf)); @@ -352,16 +352,6 @@ static int gud_stats_debugfs(struct seq_file *m, void *data) return 0; } -static const struct drm_info_list gud_debugfs_list[] = { - { "stats", gud_stats_debugfs, 0, NULL }, -}; - -static void gud_debugfs_init(struct drm_minor *minor) -{ - drm_debugfs_create_files(gud_debugfs_list, ARRAY_SIZE(gud_debugfs_list), - minor->debugfs_root, minor); -} - static const struct drm_simple_display_pipe_funcs gud_pipe_funcs = { .check = gud_pipe_check, .update = gud_pipe_update, @@ -386,7 +376,6 @@ static const struct drm_driver gud_drm_driver = { .fops = &gud_fops, DRM_GEM_SHMEM_DRIVER_OPS, .gem_prime_import = gud_gem_prime_import, - .debugfs_init = gud_debugfs_init, .name = "gud", .desc = "Generic USB Display", @@ -623,6 +612,8 @@ static int gud_probe(struct usb_interface *intf, const struct usb_device_id *id) if (!gdrm->dmadev) dev_warn(dev, "buffer sharing not supported"); + drm_debugfs_add_file(drm, "stats", gud_stats_debugfs, NULL); + ret = drm_dev_register(drm, 0); if (ret) { put_device(gdrm->dmadev); -- 2.38.1