Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp2078388rwl; Mon, 26 Dec 2022 08:34:12 -0800 (PST) X-Google-Smtp-Source: AMrXdXtO6zxQ/B4ErsEgTM3w+B7GBDD7A595l9M/hrWNvDh/QBSFHuDUn+T8QgtrxEyUG2SbtFzs X-Received: by 2002:a05:6402:2296:b0:478:b87d:94d0 with SMTP id cw22-20020a056402229600b00478b87d94d0mr15768216edb.17.1672072452058; 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=l5DMXmClWaSuITCZ5r9osZ6jUuYdY9fmpfKKBMgSJPT4uogj4ghhdlr13wdc72z7C3 DJs3sSOxZMhnLUrsKYvkoq0Vu+bBysTWLCZVGt+V2AHZ/jQi0pV6YVZU78aAtcs6fa3X r9izkYV7NqDnkJ7dDJ7bLQVda1RYSo/CnwAKtD37hcjAfVexifG9DiH8yrlk1UpsMGtp NZBlrC0HGNtdBC5MX6gtU8In3EhM9XSa4A4hgQMMbzvVxqf5H+MxqfBHSQ5iPfpyEdaD Z/6euBi2ielkTZql0cTVGu0HpY8TmtvTCQmyqtUOzMxcUpGtuN+OXDKevmwx+OQhFgjl E4cg== 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=/kZMLPqQnBN8PK+NTipJKTw+jAOXbJ78l4KtMYdcI1I=; b=rxQZJ5Wryalg067ls1Iv3/KFR+jCB6xu/siq6387N9+TT+VLEruhDlKNi6jH6C3wqP TZjHleqPvwkLbKMkwfOF8l02EdU8QkwAZ+JSM227GtGpfHWgtb/jsiZ9+vU1LEXOKQyl aZfmt+/rCPqE0dG1rd3AnJ/xeuKFrF7tVZu9G5KA3aepEfQ81UMMmv9hAvrGq9fMqbSr ch5Ha4PT2G3wxy0hLkMpOb67FnKHof5dHczPfcC4x9vDJQILYX7bb+s/EgVM6CiMYGCr LJz4J20dN/GZQWmm6laIOPsjfc8OFolG9h9tfWf7ro3eVmKnFxHrlscAmEhRUYUjsygW pZWA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@igalia.com header.s=20170329 header.b=bmtntYHb; 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 m19-20020a056402511300b0045d15f39bf4si9646332edd.479.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=bmtntYHb; 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 S232170AbiLZPw6 (ORCPT + 66 others); Mon, 26 Dec 2022 10:52:58 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39236 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232140AbiLZPw0 (ORCPT ); Mon, 26 Dec 2022 10:52:26 -0500 Received: from fanzine2.igalia.com (fanzine2.igalia.com [213.97.179.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C69226336 for ; Mon, 26 Dec 2022 07:52:25 -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=/kZMLPqQnBN8PK+NTipJKTw+jAOXbJ78l4KtMYdcI1I=; b=bmtntYHbu51SuuWqOk02JYIKIh EeAVKEi4LQN8uLcUR088djajJp8Kyuju5ZKB1gFveA/G1gGI8mcQ0GMCT1dm4qZ1PVqAX3+H01O/p NPWjOysfQfFZVbeiahMiF0rHAhlafzgmb6QPPi70+QMu5+6CNjg7gFU/IFSiKLJValEtgmSKTKaAc SQE214nyfah6VLadxcVJ5p9g6zH4yL8qIq/WsWNQmhM2eEbjs3tRuiidbNetubTLOhvb/gpxWpOjG gnf/iiP3fenG/XGvZ/sddxv/KNQV9Z3NBywwf+/A345XuM0YXmttdkZ0ckP0Ix17aWSDgZdZEzWka NuHaO+jA==; 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 1p9pm2-00AXBr-Iu; Mon, 26 Dec 2022 16:52:23 +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 5/9] drm/arc: use new debugfs device-centered functions Date: Mon, 26 Dec 2022 12:50:25 -0300 Message-Id: <20221226155029.244355-6-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 arcpgu_probe(), before drm_dev_register(). Signed-off-by: MaĆ­ra Canal --- drivers/gpu/drm/tiny/arcpgu.c | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/drivers/gpu/drm/tiny/arcpgu.c b/drivers/gpu/drm/tiny/arcpgu.c index 611bbee15071..b074a0b4c7b3 100644 --- a/drivers/gpu/drm/tiny/arcpgu.c +++ b/drivers/gpu/drm/tiny/arcpgu.c @@ -338,8 +338,8 @@ static int arcpgu_unload(struct drm_device *drm) #ifdef CONFIG_DEBUG_FS static int arcpgu_show_pxlclock(struct seq_file *m, void *arg) { - struct drm_info_node *node = (struct drm_info_node *)m->private; - struct drm_device *drm = node->minor->dev; + struct drm_debugfs_entry *entry = m->private; + struct drm_device *drm = entry->dev; struct arcpgu_drm_private *arcpgu = dev_to_arcpgu(drm); unsigned long clkrate = clk_get_rate(arcpgu->clk); unsigned long mode_clock = arcpgu->pipe.crtc.mode.crtc_clock * 1000; @@ -348,17 +348,6 @@ static int arcpgu_show_pxlclock(struct seq_file *m, void *arg) seq_printf(m, "mode: %lu\n", mode_clock); return 0; } - -static struct drm_info_list arcpgu_debugfs_list[] = { - { "clocks", arcpgu_show_pxlclock, 0 }, -}; - -static void arcpgu_debugfs_init(struct drm_minor *minor) -{ - drm_debugfs_create_files(arcpgu_debugfs_list, - ARRAY_SIZE(arcpgu_debugfs_list), - minor->debugfs_root, minor); -} #endif static const struct drm_driver arcpgu_drm_driver = { @@ -371,9 +360,6 @@ static const struct drm_driver arcpgu_drm_driver = { .patchlevel = 0, .fops = &arcpgu_drm_ops, DRM_GEM_DMA_DRIVER_OPS, -#ifdef CONFIG_DEBUG_FS - .debugfs_init = arcpgu_debugfs_init, -#endif }; static int arcpgu_probe(struct platform_device *pdev) @@ -390,6 +376,10 @@ static int arcpgu_probe(struct platform_device *pdev) if (ret) return ret; +#ifdef CONFIG_DEBUG_FS + drm_debugfs_add_file(&arcpgu->drm, "clocks", arcpgu_show_pxlclock, NULL); +#endif + ret = drm_dev_register(&arcpgu->drm, 0); if (ret) goto err_unload; -- 2.38.1