diff options
author | 2025-01-09 13:21:10 +0100 | |
---|---|---|
committer | 2025-01-14 13:02:11 +0100 | |
commit | d06905d686107c8343ff71aa4f3c881cc0a9a7b9 (patch) | |
tree | 6266b7d1143969890b43a0a018b8b21152e6f13c /include/linux/i2c.h | |
parent | i2c: Force ELAN06FA touchpad I2C bus freq to 100KHz (diff) | |
download | wireguard-linux-d06905d686107c8343ff71aa4f3c881cc0a9a7b9.tar.xz wireguard-linux-d06905d686107c8343ff71aa4f3c881cc0a9a7b9.zip |
i2c: add core-managed per-client directory in debugfs
More and more I2C client drivers use debugfs entries and currently they
need to manage a subdir for their files on their own. This means
inconsistent naming for these subdirs and they are scattered all over
the debugfs-tree as well. Not to mention the duplicated code.
Let the I2C core provide and maintain a proper directory per client.
Note: It was considered to save the additional pointer in 'struct
i2c_client' and only provide a subdir when requested via a helper
function. When sketching this approach, more and more corner cases
appeared, though, so the current solution with its simple and unabiguous
code was chosen.
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Diffstat (limited to 'include/linux/i2c.h')
-rw-r--r-- | include/linux/i2c.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/i2c.h b/include/linux/i2c.h index 66fb3d6cf686..36de788dc7fe 100644 --- a/include/linux/i2c.h +++ b/include/linux/i2c.h @@ -347,6 +347,7 @@ struct i2c_client { i2c_slave_cb_t slave_cb; /* callback for slave mode */ #endif void *devres_group_id; /* ID of probe devres group */ + struct dentry *debugfs; /* per-client debugfs dir */ }; #define to_i2c_client(d) container_of(d, struct i2c_client, dev) |