卸载模块驱动是提示错误
Device 'xxxx' does not have a release() function, it is broken and must be fixed.
在使用platform bus来编写设备驱动时,定义的平台设备如下:
- static struct platform_device buzzer_device = {
- .name = "beep",
- .id = -1,
- .dev = {
- }
- /* could list the /proc/iomem resources */
- };
卸载模块驱动是提示错误:
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了,如下:
- static void platform_buzzer_release(struct device * dev)
- {
- return ;
- }
- static struct platform_device buzzer_device = {
- .name = "beep",
- .id = -1,
- .dev = {
- .release = platform_buzzer_release,
- }
- /* could list the /proc/iomem resources */
- };
阅读(5360) | 评论(0) | 转发(0) |