Populate the sysfs device into pwmchip so that the pwm chip drivers can access its sysfs entries. Signed-off-by: Bin Liu <b-liu@ti.com> Signed-off-by: Sekhar Nori <nsekhar@ti.com>
@@ -394,6 +394,8 @@ void pwmchip_sysfs_export(struct pwm_chip *chip)
if (IS_ERR(parent)) {
dev_warn(chip->dev,
"device_create failed for pwm_chip sysfs export\n");
+ } else {
+ chip->sysfs_dev = parent;
}
@@ -291,6 +291,7 @@ struct pwm_ops {
*/
struct pwm_chip {
struct device *dev;
+ struct device *sysfs_dev;
struct list_head list;
const struct pwm_ops *ops;
int base;