aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEdward A. James <eajames@us.ibm.com>2017-12-11 16:32:49 -0500
committerGuenter Roeck <linux@roeck-us.net>2018-01-02 18:05:34 -0500
commiteb6489b696ad22a8464e20502e18014434b4b0ea (patch)
treed176fd5dd95c1f8cd01a84161ac9768db2c2c1bb
parent571e3f3a8e6582ecce2c7fd5d0a9e2ae74cece02 (diff)
hwmon: (pmbus) Export pmbus device debugfs directory entry
Pmbus client drivers, if they want to use debugfs, should use the same root directory as the pmbus debugfs entries are using. Therefore, export the device dentry for the pmbus client. Signed-off-by: Edward A. James <eajames@us.ibm.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
-rw-r--r--drivers/hwmon/pmbus/pmbus.h2
-rw-r--r--drivers/hwmon/pmbus/pmbus_core.c8
2 files changed, 10 insertions, 0 deletions
diff --git a/drivers/hwmon/pmbus/pmbus.h b/drivers/hwmon/pmbus/pmbus.h
index d39d506aa63e..1d24397d36ec 100644
--- a/drivers/hwmon/pmbus/pmbus.h
+++ b/drivers/hwmon/pmbus/pmbus.h
@@ -461,4 +461,6 @@ int pmbus_get_fan_rate_cached(struct i2c_client *client, int page, int id,
461 enum pmbus_fan_mode mode); 461 enum pmbus_fan_mode mode);
462int pmbus_update_fan(struct i2c_client *client, int page, int id, 462int pmbus_update_fan(struct i2c_client *client, int page, int id,
463 u8 config, u8 mask, u16 command); 463 u8 config, u8 mask, u16 command);
464struct dentry *pmbus_get_debugfs_dir(struct i2c_client *client);
465
464#endif /* PMBUS_H */ 466#endif /* PMBUS_H */
diff --git a/drivers/hwmon/pmbus/pmbus_core.c b/drivers/hwmon/pmbus/pmbus_core.c
index 99ab39f19bf4..f7c47d7994e7 100644
--- a/drivers/hwmon/pmbus/pmbus_core.c
+++ b/drivers/hwmon/pmbus/pmbus_core.c
@@ -2381,6 +2381,14 @@ int pmbus_do_remove(struct i2c_client *client)
2381} 2381}
2382EXPORT_SYMBOL_GPL(pmbus_do_remove); 2382EXPORT_SYMBOL_GPL(pmbus_do_remove);
2383 2383
2384struct dentry *pmbus_get_debugfs_dir(struct i2c_client *client)
2385{
2386 struct pmbus_data *data = i2c_get_clientdata(client);
2387
2388 return data->debugfs;
2389}
2390EXPORT_SYMBOL_GPL(pmbus_get_debugfs_dir);
2391
2384static int __init pmbus_core_init(void) 2392static int __init pmbus_core_init(void)
2385{ 2393{
2386 pmbus_debugfs_dir = debugfs_create_dir("pmbus", NULL); 2394 pmbus_debugfs_dir = debugfs_create_dir("pmbus", NULL);