打印
[嵌入式linux]

insmod 第二次出现问题!奇怪得很!

[复制链接]
4536|5
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
makearm|  楼主 | 2010-7-18 21:20 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
ROM, LED, TE, ce, ic
[root@MrMakearm=W]#insmod ledc.ko
Led Major = 251
Led Minor = 00
MakeLed create ok led init ok
[root@MrMakearm=W]#rmmod ledc
[root@MrMakearm=W]#insmod ledc.ko
Led Major = 251
Led Minor = 00
------------[ cut here ]------------
WARNING: at fs/sysfs/dir.c:451 sysfs_add_one+0x64/0x8c()
sysfs: cannot create duplicate filename '/devices/virtual/MakeLed'
Modules linked in: ledc(+) [last unloaded: ledc]
[<c0035628>] (unwind_backtrace+0x0/0xec) from [<c0042ccc>] (warn_slowpath_common+0x44/0x5c)
[<c0042ccc>] (warn_slowpath_common+0x44/0x5c) from [<c0042d1c>] (warn_slowpath_fmt+0x24/0x30)
[<c0042d1c>] (warn_slowpath_fmt+0x24/0x30) from [<c00dcb48>] (sysfs_add_one+0x64/0x8c)
[<c00dcb48>] (sysfs_add_one+0x64/0x8c) from [<c00dd41c>] (create_dir+0x48/0x98)
[<c00dd41c>] (create_dir+0x48/0x98) from [<c00dd4a0>] (sysfs_create_dir+0x34/0x4c)
[<c00dd4a0>] (sysfs_create_dir+0x34/0x4c) from [<c018ba38>] (kobject_add_internal+0xb8/0x18c)
[<c018ba38>] (kobject_add_internal+0xb8/0x18c) from [<c018bc80>] (kobject_add+0x4c/0x5c)
[<c018bc80>] (kobject_add+0x4c/0x5c) from [<c01cc2ac>] (get_device_parent+0xe0/0x134)
[<c01cc2ac>] (get_device_parent+0xe0/0x134) from [<c01cd038>] (device_add+0x78/0x450)
[<c01cd038>] (device_add+0x78/0x450) from [<c01cd49c>] (device_create_vargs+0x74/0xa8)
[<c01cd49c>] (device_create_vargs+0x74/0xa8) from [<c01cd4e8>] (device_create+0x18/0x20)
[<c01cd4e8>] (device_create+0x18/0x20) from [<bf009134>] (led_init+0x134/0x18c [ledc])
[<bf009134>] (led_init+0x134/0x18c [ledc]) from [<c0030384>] (do_one_initcall+0x5c/0x1b4)
[<c0030384>] (do_one_initcall+0x5c/0x1b4) from [<c0066120>] (sys_init_module+0xbc/0x1e8)
[<c0066120>] (sys_init_module+0xbc/0x1e8) from [<c0030e60>] (ret_fast_syscall+0x0/0x2c)
---[ end trace a512b0c9e9a0d7a9 ]---
kobject_add_internal failed for MakeLed with -EEXIST, don't try to register things with the same name in the same directory.
[<c0035628>] (unwind_backtrace+0x0/0xec) from [<c018bac4>] (kobject_add_internal+0x144/0x18c)
[<c018bac4>] (kobject_add_internal+0x144/0x18c) from [<c018bc80>] (kobject_add+0x4c/0x5c)
[<c018bc80>] (kobject_add+0x4c/0x5c) from [<c01cc2ac>] (get_device_parent+0xe0/0x134)
[<c01cc2ac>] (get_device_parent+0xe0/0x134) from [<c01cd038>] (device_add+0x78/0x450)
[<c01cd038>] (device_add+0x78/0x450) from [<c01cd49c>] (device_create_vargs+0x74/0xa8)
[<c01cd49c>] (device_create_vargs+0x74/0xa8) from [<c01cd4e8>] (device_create+0x18/0x20)
[<c01cd4e8>] (device_create+0x18/0x20) from [<bf009134>] (led_init+0x134/0x18c [ledc])
[<bf009134>] (led_init+0x134/0x18c [ledc]) from [<c0030384>] (do_one_initcall+0x5c/0x1b4)
[<c0030384>] (do_one_initcall+0x5c/0x1b4) from [<c0066120>] (sys_init_module+0xbc/0x1e8)
[<c0066120>] (sys_init_module+0xbc/0x1e8) from [<c0030e60>] (ret_fast_syscall+0x0/0x2c)
MakeLed create ok led init ok
[root@MrMakearm=W]#

相关帖子

沙发
xinzha| | 2010-7-18 21:43 | 只看该作者
两次insmod使用的是相同的设备名,这是不允许的。可以修改一下驱动,使用设备链的方式。

使用特权

评论回复
板凳
一朝成名| | 2010-7-19 12:47 | 只看该作者
同意ls,如果想再insmod下,先rmmod~

使用特权

评论回复
地板
wenming| | 2010-7-19 14:47 | 只看该作者
同意楼上,这个问题初学者容易犯

使用特权

评论回复
5
奇门遁甲| | 2010-7-19 20:15 | 只看该作者
在module_init所做的一些 register动作要记得在module_exit时unregister
否则,下次加载时就来问题

使用特权

评论回复
6
makearm|  楼主 | 2010-7-21 20:03 | 只看该作者
呵呵`谢谢`

我已经解决了`!谢谢你们的支持!

使用特权

评论回复
发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

0

主题

13

帖子

2

粉丝