1.
Q.
[root@FriendlyARM 2.6.32.2-FriendlyARM]# rmmod hello
rmmod: chdir(2.6.32.2): No such file or directory
到这里,问题就出现了,rmmod: chdir(2.6.32.2): No such file or directory
A.
注意这里的问题提示目录为:chdir(2.6.32.2),根据置顶帖"驱动的加载与卸载中常见问题:rmmod chdir no such file or directory 的最终解决办法"11楼wbweb的提示,于是我大胆的将开发板的/lib/modules/2.6.32.2-FriendlyARM/目录 修改为 /lib/modules/2.6.32.2/ 后,重新测试后,成功.
2.
Q.
在执行rmmod ixp4xx-ehci-hcd.ko命令的时候,出现如下oops错误:
WARNING: at drivers/base/core.c:122 device_release+0x68/0x74()
Device 'ixp4xx-ehci.0' does not have a release() function, it is broken and must be fixed.
Modules linked in: [last unloaded: ixp4xx_ehci_hcd]
[] (dump_stack+0x0/0x14) from [] (warn_slowpath+0x68/0x9c)
[] (warn_slowpath+0x0/0x9c) from [] (device_release+0x68/0x74)
r3:bf130668 r2:c039c685
r7:c7a0bf38 r6:c7a84bc0 r5:c03d7d9c r4:bf130644
[] (device_release+0x0/0x74) from [] (kobject_release+0x48/0x5c)
[] (kobject_release+0x0/0x5c) from [] (kref_put+0x78/0x88)
r6:c03cac34 r5:c017ba4c r4:bf130660
[] (kref_put+0x0/0x88) from [] (kobject_put+0x48/0x58)
r5:bf1307b0 r4:bf130644
[] (kobject_put+0x0/0x58) from [] (put_device+0x1c/0x20)
r4:bf1305e0
[] (put_device+0x0/0x20) from [] (platform_device_put+0x1c/0x20)
[] (platform_device_put+0x0/0x20) from [] (platform_device_unregister+0x1c/0x20)
[]
(platform_device_unregister+0x0/0x20) from []
(ixp4xx_ehci_cleanup+0x38/0x4c [ixp4xx_ehci_hcd])
r4:00000000
[] (ixp4xx_ehci_cleanup+0x0/0x4c [ixp4xx_ehci_hcd]) from [] (sys_delete_module+0x20c/0x280)
[] (sys_delete_module+0x0/0x280) from [] (ret_fast_syscall+0x0/0x2c)
r8:c0025024 r7:00000081 r6:6863695f r5:78785f65 r4:69787034
A.
这个错误发生在删除usb驱动时对设备进行unregister的时候:
platform_device_unregister(device);//device = &ixdp4xx_ehci_controller[0];
其中ixdp4xx_ehci_controller的定义如下:
static struct platform_device ixdp4xx_ehci_controller[] = {
/* Host controller 0 */
{
.name = IXP4XX_EHCI_NAME,
.id = 0,
.dev = {
.dma_mask = &ehci_dma_mask,
.coherent_dma_mask = 0xffffffff,
},
.resource = ixp4xx_ehci_host0_res,
.num_resources = 2,
},
}
WARNING警告出自内核的如下代码:driver/base/core.c
static void device_release(struct kobject *kobj)
{
struct device *dev = to_dev(kobj);
if (dev->release)
dev->release(dev);
else if (dev->type && dev->type->release)
dev->type->release(dev);
else if (dev->class && dev->class->dev_release)
dev->class->dev_release(dev);
else
WARN(1, KERN_ERR "Device '%s' does not have a release() "
"function, it is broken and must be fixed.\n",
dev_name(dev));
}
根据警告信息提示,我在ixdp4xx_ehci_controller[0]的.dev域下实现了一个空的release函数,解决办法如下:
static void ixdp4xx_ehci_controller_release(struct device *dev)
{
printk(KERN_INFO "\nixdp4xx_ehci_controller_release...");
}
static struct platform_device ixdp4xx_ehci_controller[] = {
/* Host controller 0 */
{
.name = IXP4XX_EHCI_NAME,
.id = 0,
.dev = {
.dma_mask = &ehci_dma_mask,
.coherent_dma_mask = 0xffffffff,
.release = &ixdp4xx_ehci_controller_release
},
.resource = ixp4xx_ehci_host0_res,
.num_resources = 2,
},
}
然后ok
3.
Q.
就会出现:Syntax error: word unexpected (expect ing ")"),郁闷了好久!
一直都是用ftp将s3c2440_adc_test传到开发板上,没有发现什么错误,但运行就是出错。
A.
最终确定:s3c2440_adc_test文件传输的不完整,
导致运行s3c2440_adc_test出现错误:Syntax error: word unexpected (expect ing ")")
阅读(1277) | 评论(0) | 转发(0) |