]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
mfd: aat2870: Use per-client debugfs directory
authorWolfram Sang <wsa+renesas@sang-engineering.com>
Tue, 18 Mar 2025 09:13:41 +0000 (10:13 +0100)
committerLee Jones <lee@kernel.org>
Thu, 22 May 2025 14:49:58 +0000 (15:49 +0100)
The I2C core now provides a debugfs entry for each client. Let this
driver use it instead of the custom directory in debugfs root. Further
improvements by this change: automatic clean up on removal, support of
multiple instances.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Link: https://lore.kernel.org/r/20250318091426.22258-2-wsa+renesas@sang-engineering.com
Signed-off-by: Lee Jones <lee@kernel.org>
drivers/mfd/aat2870-core.c
include/linux/mfd/aat2870.h

index 8ef510e84688b6105f8b5ed3d69ad57e6e41b4fa..34d66ba9646abc19a4310cd0098d06200085ea03 100644 (file)
@@ -320,9 +320,7 @@ static const struct file_operations aat2870_reg_fops = {
 
 static void aat2870_init_debugfs(struct aat2870_data *aat2870)
 {
-       aat2870->dentry_root = debugfs_create_dir("aat2870", NULL);
-
-       debugfs_create_file("regs", 0644, aat2870->dentry_root, aat2870,
+       debugfs_create_file("regs", 0644, aat2870->client->debugfs, aat2870,
                            &aat2870_reg_fops);
 }
 
index 2445842d482dc77118191c0ee022a6c123f1294e..c7a3c53eba681bf9a3272ab5be517f3b53279ec6 100644 (file)
@@ -133,9 +133,6 @@ struct aat2870_data {
        int (*read)(struct aat2870_data *aat2870, u8 addr, u8 *val);
        int (*write)(struct aat2870_data *aat2870, u8 addr, u8 val);
        int (*update)(struct aat2870_data *aat2870, u8 addr, u8 mask, u8 val);
-
-       /* for debugfs */
-       struct dentry *dentry_root;
 };
 
 struct aat2870_subdev_info {