按照手册实验进行了修改了设备树,完成编译,利用cat /proc/device-tree/出现gpioled节点,然后提供的视频代码,编译通过后进行加载驱动,出现如下错误。/lib/modules/4.1.15 # modprobe gpioled.ko
gpioled major = 249, minor = 0
can't find led gpio
gpioled major = 248, minor = 0
------------[ cut here ]------------
WARNING: CPU: 0 PID: 69 at fs/sysfs/dir.c:31 sysfs_warn_dup+0x60/0x70()
sysfs: cannot create duplicate filename '/class/gpioled'
Modules linked in: gpioled(O+)
CPU: 0 PID: 69 Comm: modprobe Tainted: G O 4.1.15 #1
Hardware name: Freescale i.MX6 Ultralite (Device Tree)
[<80015dbc>] (unwind_backtrace) from [<80012748>] (show_stack+0x10/0x14)
[<80012748>] (show_stack) from [<80683130>] (dump_stack+0x84/0xc4)
[<80683130>] (dump_stack) from [<80036ee0>] (warn_slowpath_common+0x80/0xb0)
[<80036ee0>] (warn_slowpath_common) from [<80036f40>] (warn_slowpath_fmt+0x30/0x40)
[<80036f40>] (warn_slowpath_fmt) from [<8014ab1c>] (sysfs_warn_dup+0x60/0x70)
[<8014ab1c>] (sysfs_warn_dup) from [<8014abfc>] (sysfs_create_dir_ns+0x88/0x98)
[<8014abfc>] (sysfs_create_dir_ns) from [<802983d8>] (kobject_add_internal+0xa0/0x2f0)
[<802983d8>] (kobject_add_internal) from [<802986e0>] (kset_register+0x50/0x7c)
[<802986e0>] (kset_register) from [<8034916c>] (__class_register+0xc8/0x1b8)
[<8034916c>] (__class_register) from [<803492a4>] (__class_create+0x48/0x74)
[<803492a4>] (__class_create) from [<7f006098>] (led_init+0x98/0x194 [gpioled])
[<7f006098>] (led_init [gpioled]) from [<80009730>] (do_one_initcall+0x8c/0x1d8)
[<80009730>] (do_one_initcall) from [<8068109c>] (do_init_module+0x5c/0x1a8)
[<8068109c>] (do_init_module) from [<8009560c>] (load_module+0x1904/0x1dc8)
[<8009560c>] (load_module) from [<80095ba0>] (SyS_init_module+0xd0/0x120)
[<80095ba0>] (SyS_init_module) from [<8000f480>] (ret_fast_syscall+0x0/0x3c)
---[ end trace 3a172c73d46e76ff ]---
------------[ cut here ]------------
WARNING: CPU: 0 PID: 69 at lib/kobject.c:240 kobject_add_internal+0x284/0x2f0()
kobject_add_internal failed for gpioled with -EEXIST, don't try to register things with the same name in the same directory.
Modules linked in: gpioled(O+)
CPU: 0 PID: 69 Comm: modprobe Tainted: G W O 4.1.15 #1
Hardware name: Freescale i.MX6 Ultralite (Device Tree)
[<80015dbc>] (unwind_backtrace) from [<80012748>] (show_stack+0x10/0x14)
[<80012748>] (show_stack) from [<80683130>] (dump_stack+0x84/0xc4)
[<80683130>] (dump_stack) from [<80036ee0>] (warn_slowpath_common+0x80/0xb0)
[<80036ee0>] (warn_slowpath_common) from [<80036f40>] (warn_slowpath_fmt+0x30/0x40)
[<80036f40>] (warn_slowpath_fmt) from [<802985bc>] (kobject_add_internal+0x284/0x2f0)
[<802985bc>] (kobject_add_internal) from [<802986e0>] (kset_register+0x50/0x7c)
[<802986e0>] (kset_register) from [<8034916c>] (__class_register+0xc8/0x1b8)
[<8034916c>] (__class_register) from [<803492a4>] (__class_create+0x48/0x74)
[<803492a4>] (__class_create) from [<7f006098>] (led_init+0x98/0x194 [gpioled])
[<7f006098>] (led_init [gpioled]) from [<80009730>] (do_one_initcall+0x8c/0x1d8)
[<80009730>] (do_one_initcall) from [<8068109c>] (do_init_module+0x5c/0x1a8)
[<8068109c>] (do_init_module) from [<8009560c>] (load_module+0x1904/0x1dc8)
[<8009560c>] (load_module) from [<80095ba0>] (SyS_init_module+0xd0/0x120)
[<80095ba0>] (SyS_init_module) from [<8000f480>] (ret_fast_syscall+0x0/0x3c)
---[ end trace 3a172c73d46e7700 ]---
请各位大神多多指点,小弟感激不尽!