From 67f6b601fbc459082f0c46d350c0858a36827c42 Mon Sep 17 00:00:00 2001 From: William Wu Date: Mon, 6 Jun 2022 15:54:37 +0800 Subject: [PATCH] phy: rockchip: inno-usb3: debugfs creation based on CONFIG_DEBUG_FS MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It can avoid potential build warn/error when CONFIG_DEBUG_FS is not set. And also fix the following warning: drivers/phy/rockchip/phy-rockchip-inno-usb3.c:297:5: warning: no previous prototype for ‘rockchip_u3phy_debugfs_init’ [-Wmissing-prototypes] Signed-off-by: William Wu Change-Id: Ia5f8c0484f2aea53ba6b9eba0b5c8a68b9fc350e --- drivers/phy/rockchip/phy-rockchip-inno-usb3.c | 26 +++---------------- 1 file changed, 3 insertions(+), 23 deletions(-) diff --git a/drivers/phy/rockchip/phy-rockchip-inno-usb3.c b/drivers/phy/rockchip/phy-rockchip-inno-usb3.c index 9d9a5fd444bf..63e482b1ce67 100644 --- a/drivers/phy/rockchip/phy-rockchip-inno-usb3.c +++ b/drivers/phy/rockchip/phy-rockchip-inno-usb3.c @@ -141,7 +141,6 @@ struct rockchip_u3phy { struct regmap *grf; int um_ls_irq; struct clk *clks[U3PHY_MAX_CLKS]; - struct dentry *root; struct regulator *vbus; struct reset_control *rsts[U3PHY_RESET_MAX]; struct rockchip_u3phy_apbcfg apbcfg; @@ -294,32 +293,13 @@ static const struct file_operations rockchip_u3phy_usb2_only_fops = { .release = single_release, }; -int rockchip_u3phy_debugfs_init(struct rockchip_u3phy *u3phy) +static void rockchip_u3phy_debugfs_init(struct rockchip_u3phy *u3phy) { struct dentry *root; - struct dentry *file; - int ret; root = debugfs_create_dir(dev_name(u3phy->dev), NULL); - if (!root) { - ret = -ENOMEM; - goto err0; - } - - u3phy->root = root; - - file = debugfs_create_file("u3phy_mode", 0644, root, - u3phy, &rockchip_u3phy_usb2_only_fops); - if (!file) { - ret = -ENOMEM; - goto err1; - } - return 0; - -err1: - debugfs_remove_recursive(root); -err0: - return ret; + debugfs_create_file("u3phy_mode", 0644, root, + u3phy, &rockchip_u3phy_usb2_only_fops); } static const char *get_rest_name(enum rockchip_u3phy_rest_req rst)