好了,下面说下初始化函数:
static int __init leds_init(void){
leds_class = class_create(THIS_MODULE, "leds");
if (IS_ERR(leds_class))
return PTR_ERR(leds_class);
leds_class->suspend = led_suspend;
leds_class->resume = led_resume;
leds_class->dev_attrs = led_class_attrs; //属性文件,sys下的接口,重点看一下
return 0;
}