因为之前改过串口的ttyS*交换
https://blog.csdn.net/longmin96/article/details/125312960
然后现在客户又来要pwmchipX节点交换
因为PWM接在PWM2和PWM3上,但是适配之前的pwmchip1和pwmchip2节点
于是需求:把pwmchip1和pwmchip3交换
然后尝试了很多种方法都未成功,最后终于
参考这里找到了
\sdk\kernel\drivers\pwm\sysfs.c
void pwmchip_sysfs_export(struct pwm_chip *chip)
{
struct device *parent;
/*
* If device_create() fails the pwm_chip is still usable by
* the kernel its just not exported.
*/
+ #if 0
parent = device_create(&pwm_class, chip->dev, MKDEV(0, 0), chip,
"pwmchip%d", chip->base);
if (IS_ERR(parent)) {
dev_warn(chip->dev,
"device_create failed for pwm_chip sysfs export\n")