From 3eebf41f604cfaa64faeb1859ec07eb10674470c Mon Sep 17 00:00:00 2001 From: Li Jun <jun.li@nxp.com> Date: Tue, 3 Aug 2021 15:38:07 +0800 Subject: [PATCH] LF-4259-1 phy: add debugfs root entry Add a root debugfs dir for generic phy subsystem. Reviewed-by: Haibo Chen <haibo.chen@nxp.com> Signed-off-by: Li Jun <jun.li@nxp.com> --- drivers/phy/phy-core.c | 5 +++++ include/linux/phy/phy.h | 2 ++ 2 files changed, 7 insertions(+) diff --git a/drivers/phy/phy-core.c b/drivers/phy/phy-core.c index 71cb1082632626..3fb7b34f994966 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> @@ -24,6 +25,8 @@ static DEFINE_MUTEX(phy_provider_mutex); static LIST_HEAD(phy_provider_list); static LIST_HEAD(phys); static DEFINE_IDA(phy_ida); +struct dentry *phy_debugfs_root; +EXPORT_SYMBOL_GPL(phy_debugfs_root); static void devm_phy_release(struct device *dev, void *res) { @@ -1163,6 +1166,8 @@ static int __init phy_core_init(void) phy_class->dev_release = phy_release; + phy_debugfs_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 e435bdb0bab355..95465cd7811db6 100644 --- a/include/linux/phy/phy.h +++ b/include/linux/phy/phy.h @@ -201,6 +201,8 @@ static inline void *phy_get_drvdata(struct phy *phy) return dev_get_drvdata(&phy->dev); } +extern struct dentry *phy_debugfs_root; + #if IS_ENABLED(CONFIG_GENERIC_PHY) int phy_pm_runtime_get(struct phy *phy); int phy_pm_runtime_get_sync(struct phy *phy); -- GitLab