Chinaunix首页 | 论坛 | 博客
  • 博客访问: 518550
  • 博文数量: 81
  • 博客积分: 1438
  • 博客等级: 上尉
  • 技术积分: 866
  • 用 户 组: 普通用户
  • 注册时间: 2011-06-12 11:32
文章分类

全部博文(81)

文章存档

2014年(1)

2013年(1)

2012年(33)

2011年(46)

分类: 嵌入式

2012-01-31 16:19:13

卸载模块驱动是提示错误
Device 'xxxx' does not have a release() function, it is broken and must be fixed.
 

在使用platform bus来编写设备驱动时,定义的平台设备如下:

  1. static struct platform_device buzzer_device = {
  2.     .name        = "beep",
  3.     .id        = -1,
  4.     .dev = {
  5.     }
  6.     /* could list the /proc/iomem resources */
  7. };

 

卸载模块驱动是提示错误:

WARNING: at drivers/base/core.c:143 device_release+0x70/0x84()

Device ‘beep’ does not have a release() function, it is broken and must be fixed.

 

在平台设备文件中添加.release的实现就OK了,如下:

  1. static void platform_buzzer_release(struct device * dev)
  2. {
  3.     return ;
  4. }


  5. static struct platform_device buzzer_device = {
  6.     .name        = "beep",
  7.     .id        = -1,
  8.     .dev = {
  9.         .release = platform_buzzer_release,
  10.     }
  11.     /* could list the /proc/iomem resources */
  12. };

 

 

阅读(5190) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~