Message ID | 20221110132716.12294-2-chunfeng.yun@mediatek.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp150149wru; Thu, 10 Nov 2022 05:34:39 -0800 (PST) X-Google-Smtp-Source: AMsMyM7bq8wiCuWdyKRWAbBs034JLraGr0Rj8HDZ93x65B3Q6wa5teN0k/usgsAWki+D+FDkR2Ue X-Received: by 2002:a17:90a:ea95:b0:216:df8f:14e9 with SMTP id h21-20020a17090aea9500b00216df8f14e9mr33360965pjz.222.1668087278771; Thu, 10 Nov 2022 05:34:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668087278; cv=none; d=google.com; s=arc-20160816; b=jhZ8NDF1TK0TWqgPNP7zZTqjhH6kCCpmi9zkGKfSbcY8yzwNNOOruGCLsf5XVnV9Fk f8LmEkJHSZmAAjhESqu1QUkWljrPwCyR4dWMzt8QfHJ9w4JlORnFNNEpjtVaDleafAfT rx20fW9vfGZ7P7jc60zlr65HneZ71PYpIqwz6JZt3WRGwhBTPU885vZw7XLrWgodYQWL ub0zMCiTTGQUKUd3i2tUmCd+x1uVR7lzs3gQnTyR9YeR+1JluV2gjMjV/Mb5JcKRXlgj 2AIH42jcKlSNAReku2Pf3xQhB8IdH3FEumt3bVxvSJugPhaCrSM5HNZF0sA/uPqz9aix qn3w== 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=ISjS9vItpte95t/ScfBBhnWRioYpdTc4gkkpbIxsuts=; b=r8jAPU8RfWMIhvcPR/UHqolIpTvNL5wfYWioIg+8LgXwPaWOMpWK9mhjAIIM45+aJd mGz8O+OHAxzNj7zGZUR0ok6p+DvLTtHWhLe1nuh58zmY93zhDJZ+9duLQMonaS2+wpTH dXb2SROiLTdyFYI1Cul0or0WBxCqR85MaBzqY33UHMfiDhnO4AqzSpn8L6E/I0oMyaLb 3nkYj5Q6OFNMs+ARqBiuXSgVo3IrHKXeLX64sUC1OZF/5x2QG8mkbr0PBnCmzJWOjGjR iQvcV+NKRaKKKOOtE1Fsb6FBIoyTZfUxDb+cSVQEN/9nhX2k0pI8V9fKaibZ9MyTIGZq 8d7Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=Td92Rnqc; 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; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y3-20020a17090abd0300b001fdd01d3d1bsi3769088pjr.168.2022.11.10.05.34.19; Thu, 10 Nov 2022 05:34:38 -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=pass header.i=@mediatek.com header.s=dk header.b=Td92Rnqc; 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; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229488AbiKJN1c (ORCPT <rfc822;winker.wchi@gmail.com> + 99 others); Thu, 10 Nov 2022 08:27:32 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46668 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229499AbiKJN11 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 10 Nov 2022 08:27:27 -0500 Received: from mailgw02.mediatek.com (unknown [210.61.82.184]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1ACD36A77E for <linux-kernel@vger.kernel.org>; Thu, 10 Nov 2022 05:27:25 -0800 (PST) X-UUID: 8997b60076dc475ead787c84b95da564-20221110 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Type:Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; bh=ISjS9vItpte95t/ScfBBhnWRioYpdTc4gkkpbIxsuts=; b=Td92RnqcYXUGSYJ8yLrZhJoFfgYHczI+hY0t+MsNgWA5S3S9Cdx4Cj2WwkQtv0onZoUP1P3Sr6qUacxhe+4i0gylsPL4VDSJDEed65eWw4xOZIbpO4Kg1o+05H4cfpGLX+adQFZn8Mjd0P8YnygLGeHQ3vv1NSfBIg67pxhUqck=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.12,REQID:241461dc-c833-40a3-ab01-ba0679151898,IP:0,U RL:0,TC:0,Content:0,EDM:0,RT:0,SF:95,FILE:0,BULK:0,RULE:Release_Ham,ACTION :release,TS:95 X-CID-INFO: VERSION:1.1.12,REQID:241461dc-c833-40a3-ab01-ba0679151898,IP:0,URL :0,TC:0,Content:0,EDM:0,RT:0,SF:95,FILE:0,BULK:0,RULE:Spam_GS981B3D,ACTION :quarantine,TS:95 X-CID-META: VersionHash:62cd327,CLOUDID:4a86315d-100c-4555-952b-a62c895efded,B ulkID:221110212721OY81UAOK,BulkQuantity:0,Recheck:0,SF:28|17|19|48,TC:nil, Content:0,EDM:-3,IP:nil,URL:11|1,File:nil,Bulk:nil,QS:nil,BEC:nil,COL:0 X-UUID: 8997b60076dc475ead787c84b95da564-20221110 Received: from mtkmbs13n1.mediatek.inc [(172.21.101.193)] by mailgw02.mediatek.com (envelope-from <chunfeng.yun@mediatek.com>) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 1587391723; Thu, 10 Nov 2022 21:27:20 +0800 Received: from mtkmbs11n2.mediatek.inc (172.21.101.187) by mtkmbs11n1.mediatek.inc (172.21.101.185) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.792.15; Thu, 10 Nov 2022 21:27:19 +0800 Received: from localhost.localdomain (10.17.3.154) by mtkmbs11n2.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.792.15 via Frontend Transport; Thu, 10 Nov 2022 21:27:18 +0800 From: Chunfeng Yun <chunfeng.yun@mediatek.com> To: Vinod Koul <vkoul@kernel.org> CC: Chunfeng Yun <chunfeng.yun@mediatek.com>, Kishon Vijay Abraham I <kishon@ti.com>, Matthias Brugger <matthias.bgg@gmail.com>, Nathan Chancellor <nathan@kernel.org>, Nick Desaulniers <ndesaulniers@google.com>, Tom Rix <trix@redhat.com>, AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>, <linux-arm-kernel@lists.infradead.org>, <linux-mediatek@lists.infradead.org>, <linux-phy@lists.infradead.org>, <linux-kernel@vger.kernel.org>, <llvm@lists.linux.dev>, Eddie Hung <eddie.hung@mediatek.com>, Tianping Fang <tianping.fang@mediatek.com> Subject: [PATCH v4 2/3] phy: core: add debugfs root Date: Thu, 10 Nov 2022 21:27:15 +0800 Message-ID: <20221110132716.12294-2-chunfeng.yun@mediatek.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221110132716.12294-1-chunfeng.yun@mediatek.com> References: <20221110132716.12294-1-chunfeng.yun@mediatek.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-MTK: N X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS, SPF_PASS,UNPARSEABLE_RELAY 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749116286389828668?= X-GMAIL-MSGID: =?utf-8?q?1749116286389828668?= |
Series |
[v4,1/3] phy: mediatek: fix build warning caused by clang for powerpc
|
|
Commit Message
Chunfeng Yun (云春峰)
Nov. 10, 2022, 1:27 p.m. UTC
Add a debugfs root for phy class, then phy drivers can add debugfs files
under this folder.
Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
---
v2~v4: no changes
---
drivers/phy/phy-core.c | 6 ++++++
include/linux/phy/phy.h | 2 ++
2 files changed, 8 insertions(+)
Comments
On 10-11-22, 21:27, Chunfeng Yun wrote: > Add a debugfs root for phy class, then phy drivers can add debugfs files > under this folder. > > Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com> > --- > v2~v4: no changes > --- > drivers/phy/phy-core.c | 6 ++++++ > include/linux/phy/phy.h | 2 ++ > 2 files changed, 8 insertions(+) > > diff --git a/drivers/phy/phy-core.c b/drivers/phy/phy-core.c > index d93ddf1262c5..2f9f69190519 100644 > --- a/drivers/phy/phy-core.c > +++ b/drivers/phy/phy-core.c > @@ -11,6 +11,7 @@ > #include <linux/export.h> > #include <linux/module.h> > #include <linux/err.h> > +#include <linux/debugfs.h> > #include <linux/device.h> > #include <linux/slab.h> > #include <linux/of.h> > @@ -1204,6 +1205,9 @@ void devm_of_phy_provider_unregister(struct device *dev, > } > EXPORT_SYMBOL_GPL(devm_of_phy_provider_unregister); > > +struct dentry *phy_debug_root; > +EXPORT_SYMBOL_GPL(phy_debug_root); Why expose this to whole world? Alternate approach would be to add this in struct phy > + > /** > * phy_release() - release the phy > * @dev: the dev member within phy > @@ -1233,6 +1237,8 @@ static int __init phy_core_init(void) > > phy_class->dev_release = phy_release; > > + phy_debug_root = debugfs_create_dir("phy", NULL); > + > return 0; > } > device_initcall(phy_core_init); > diff --git a/include/linux/phy/phy.h b/include/linux/phy/phy.h > index b1413757fcc3..c398749d49b9 100644 > --- a/include/linux/phy/phy.h > +++ b/include/linux/phy/phy.h > @@ -205,6 +205,8 @@ struct phy_lookup { > #define devm_of_phy_provider_register_full(dev, children, xlate) \ > __devm_of_phy_provider_register(dev, children, THIS_MODULE, xlate) > > +extern struct dentry *phy_debug_root; > + > static inline void phy_set_drvdata(struct phy *phy, void *data) > { > dev_set_drvdata(&phy->dev, data); > -- > 2.18.0
On Thu, 2022-11-24 at 23:09 +0530, Vinod Koul wrote: > On 10-11-22, 21:27, Chunfeng Yun wrote: > > Add a debugfs root for phy class, then phy drivers can add debugfs > > files > > under this folder. > > > > Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com> > > --- > > v2~v4: no changes > > --- > > drivers/phy/phy-core.c | 6 ++++++ > > include/linux/phy/phy.h | 2 ++ > > 2 files changed, 8 insertions(+) > > > > diff --git a/drivers/phy/phy-core.c b/drivers/phy/phy-core.c > > index d93ddf1262c5..2f9f69190519 100644 > > --- a/drivers/phy/phy-core.c > > +++ b/drivers/phy/phy-core.c > > @@ -11,6 +11,7 @@ > > #include <linux/export.h> > > #include <linux/module.h> > > #include <linux/err.h> > > +#include <linux/debugfs.h> > > #include <linux/device.h> > > #include <linux/slab.h> > > #include <linux/of.h> > > @@ -1204,6 +1205,9 @@ void devm_of_phy_provider_unregister(struct > > device *dev, > > } > > EXPORT_SYMBOL_GPL(devm_of_phy_provider_unregister); > > > > +struct dentry *phy_debug_root; > > +EXPORT_SYMBOL_GPL(phy_debug_root); > > Why expose this to whole world? Alternate approach would be to add > this > in struct phy If only add it in struct phy, many phy folders will be created under /sys/kernel/debug/, and create them under /sys/kernel/debug/phy seems more clearer, this also follows other class, such as usb > > > + > > /** > > * phy_release() - release the phy > > * @dev: the dev member within phy > > @@ -1233,6 +1237,8 @@ static int __init phy_core_init(void) > > > > phy_class->dev_release = phy_release; > > > > + phy_debug_root = debugfs_create_dir("phy", NULL); > > + > > return 0; > > } > > device_initcall(phy_core_init); > > diff --git a/include/linux/phy/phy.h b/include/linux/phy/phy.h > > index b1413757fcc3..c398749d49b9 100644 > > --- a/include/linux/phy/phy.h > > +++ b/include/linux/phy/phy.h > > @@ -205,6 +205,8 @@ struct phy_lookup { > > #define devm_of_phy_provider_register_full(dev, children, xlate) \ > > __devm_of_phy_provider_register(dev, children, THIS_MODULE, > > xlate) > > > > +extern struct dentry *phy_debug_root; > > + > > static inline void phy_set_drvdata(struct phy *phy, void *data) > > { > > dev_set_drvdata(&phy->dev, data); > > -- > > 2.18.0 > >
diff --git a/drivers/phy/phy-core.c b/drivers/phy/phy-core.c index d93ddf1262c5..2f9f69190519 100644 --- a/drivers/phy/phy-core.c +++ b/drivers/phy/phy-core.c @@ -11,6 +11,7 @@ #include <linux/export.h> #include <linux/module.h> #include <linux/err.h> +#include <linux/debugfs.h> #include <linux/device.h> #include <linux/slab.h> #include <linux/of.h> @@ -1204,6 +1205,9 @@ void devm_of_phy_provider_unregister(struct device *dev, } EXPORT_SYMBOL_GPL(devm_of_phy_provider_unregister); +struct dentry *phy_debug_root; +EXPORT_SYMBOL_GPL(phy_debug_root); + /** * phy_release() - release the phy * @dev: the dev member within phy @@ -1233,6 +1237,8 @@ static int __init phy_core_init(void) phy_class->dev_release = phy_release; + phy_debug_root = debugfs_create_dir("phy", NULL); + return 0; } device_initcall(phy_core_init); diff --git a/include/linux/phy/phy.h b/include/linux/phy/phy.h index b1413757fcc3..c398749d49b9 100644 --- a/include/linux/phy/phy.h +++ b/include/linux/phy/phy.h @@ -205,6 +205,8 @@ struct phy_lookup { #define devm_of_phy_provider_register_full(dev, children, xlate) \ __devm_of_phy_provider_register(dev, children, THIS_MODULE, xlate) +extern struct dentry *phy_debug_root; + static inline void phy_set_drvdata(struct phy *phy, void *data) { dev_set_drvdata(&phy->dev, data);