From 4469e01255c449a42a94b0a772d5c8021d7a429f Mon Sep 17 00:00:00 2001 From: yxj Date: Wed, 10 Apr 2013 14:01:53 +0800 Subject: [PATCH] mfd:rk616:create debug node rk616-reg under dir debugfs/rk616/ --- drivers/mfd/rk616-core.c | 8 +++++++- include/linux/mfd/rk616.h | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/mfd/rk616-core.c b/drivers/mfd/rk616-core.c index 81a0c7fde72c..7dbd7ea44799 100644 --- a/drivers/mfd/rk616-core.c +++ b/drivers/mfd/rk616-core.c @@ -229,7 +229,13 @@ static int rk616_i2c_probe(struct i2c_client *client,const struct i2c_device_id rk616->read_dev = rk616_i2c_read_reg; rk616->write_dev = rk616_i2c_write_reg; #if defined(CONFIG_DEBUG_FS) - debugfs_create_file("rk616-reg", S_IRUSR,NULL,rk616,&rk616_reg_fops); + rk616->debugfs_dir = debugfs_create_dir("rk616", NULL); + if (IS_ERR(rk616->debugfs_dir)) + { + dev_err(rk616->dev,"failed to create debugfs dir for rk616!\n"); + } + else + debugfs_create_file("rk616-reg", S_IRUSR,rk616->debugfs_dir,rk616,&rk616_reg_fops); #endif rk616_clk_common_init(rk616); ret = mfd_add_devices(rk616->dev, -1, diff --git a/include/linux/mfd/rk616.h b/include/linux/mfd/rk616.h index a6b2f690bd0f..68b9637193bf 100644 --- a/include/linux/mfd/rk616.h +++ b/include/linux/mfd/rk616.h @@ -190,6 +190,7 @@ struct mfd_rk616 { struct rk616_platform_data *pdata; struct rk616_route *route; //display path router struct i2c_client *client; + struct dentry *debugfs_dir; int (*read_dev)(struct mfd_rk616 *rk616,u16 reg,u32 *pval); int (*write_dev)(struct mfd_rk616 *rk616,u16 reg,u32 *pval); }; -- 2.34.1