Quantcast
Channel: Active questions tagged kernel - Stack Overflow
Viewing all articles
Browse latest Browse all 6334

In the PWM driver in Linux, exporting a device will create a link

$
0
0

In kernel 4.17.0, when I want to export a pwm_device0 from pwm_chip0, a link corresponding to this pwm_device0 is created under /sys/class/pwm. When I want to export pwm_device0 from pwm_chip1, it conflicts with the link created by pwm_chip0, which prevents the second pwm_device0 from being exported.Is the code to create the link the following line?

    export->child.class = parent->class;    export->child.release = pwm_export_release;    export->child.parent = parent;    export->child.devt = MKDEV(0, 0);    export->child.groups = pwm_groups;    dev_set_name(&export->child, "pwm%u%u", pwm->chip->base, pwm->hwpwm);    ret = device_register(&export->child);

But the code to create the link was removed in kernel version 4.19.68.enter image description here

    export->child.release = pwm_export_release;    export->child.parent = parent;    export->child.devt = MKDEV(0, 0);    export->child.groups = pwm_groups;    dev_set_name(&export->child, "pwm%u", pwm->hwpwm);    ret = device_register(&export->child);

This line of code to create the link was also not available in versions earlier than 4.17.0.I would like to ask what is the purpose of creating the link in the first place. Thank you so much.


Viewing all articles
Browse latest Browse all 6334

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>