Lines Matching refs:parent

263 static int pwm_export_child(struct device *parent, struct pwm_device *pwm)
283 export->child.parent = parent;
297 kobject_uevent_env(&parent->kobj, KOBJ_CHANGE, pwm_prop);
308 static int pwm_unexport_child(struct device *parent, struct pwm_device *pwm)
317 child = device_find_child(parent, pwm, pwm_unexport_match);
324 kobject_uevent_env(&parent->kobj, KOBJ_CHANGE, pwm_prop);
335 static ssize_t export_store(struct device *parent, struct device_attribute *attr, const char *buf, size_t len)
337 struct pwm_chip *chip = dev_get_drvdata(parent);
356 ret = pwm_export_child(parent, pwm);
365 static ssize_t unexport_store(struct device *parent, struct device_attribute *attr, const char *buf, size_t len)
367 struct pwm_chip *chip = dev_get_drvdata(parent);
380 ret = pwm_unexport_child(parent, &chip->pwms[hwpwm]);
386 static ssize_t npwm_show(struct device *parent, struct device_attribute *attr, char *buf)
388 const struct pwm_chip *chip = dev_get_drvdata(parent);
403 static struct pwm_export *pwm_class_get_state(struct device *parent, struct pwm_device *pwm, struct pwm_state *state)
412 child = device_find_child(parent, pwm, pwm_unexport_match);
436 static int pwm_class_resume_npwm(struct device *parent, unsigned int npwm)
438 struct pwm_chip *chip = dev_get_drvdata(parent);
447 export = pwm_class_get_state(parent, pwm, &state);
462 static int __maybe_unused pwm_class_suspend(struct device *parent)
464 struct pwm_chip *chip = dev_get_drvdata(parent);
473 export = pwm_class_get_state(parent, pwm, &state);
486 pwm_class_resume_npwm(parent, i);
494 static int __maybe_unused pwm_class_resume(struct device *parent)
496 struct pwm_chip *chip = dev_get_drvdata(parent);
498 return pwm_class_resume_npwm(parent, chip->npwm);
510 static int pwmchip_sysfs_match(struct device *parent, const void *data)
512 return dev_get_drvdata(parent) == data;
517 struct device *parent;
523 parent = device_create(&pwm_class, chip->dev, MKDEV(0, 0), chip, "pwmchip%d", chip->base);
524 if (IS_ERR(parent)) {
531 struct device *parent;
534 parent = class_find_device(&pwm_class, NULL, chip, pwmchip_sysfs_match);
535 if (!parent) {
543 pwm_unexport_child(parent, pwm);
547 put_device(parent);
548 device_unregister(parent);