mfd:rk616:create debug node rk616-reg under dir debugfs/rk616/
authoryxj <yxj@rock-chips.com>
Wed, 10 Apr 2013 06:01:53 +0000 (14:01 +0800)
committeryxj <yxj@rock-chips.com>
Wed, 10 Apr 2013 08:31:27 +0000 (16:31 +0800)
drivers/mfd/rk616-core.c
include/linux/mfd/rk616.h

index 81a0c7fde72c6672dad8a8d6467afa8910edf352..7dbd7ea44799c94fe0efc7cfccc0578462355855 100644 (file)
@@ -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,
index a6b2f690bd0f8c8ee35275a49d08f6e62fd4cf90..68b9637193bf13dd927410b6a8b01f869112f72d 100644 (file)
@@ -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);
 };