the linux driver probe failed but it reside in memory still.

呆子毛 2011-07-14 09:17:47
Hi all, I has a driver for i2c device, when I register it by insmod i2c_device.ko command, and it failed at probe function,then I return -1, but the i2c_device driver reside in memory still use the lsmod command to see it. now I want to the driver to exit memory, when it probe failed, so how I do it ? thanks!~~~~
...全文
65 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
呆子毛 2011-07-18
  • 打赏
  • 举报
回复
what I do in failed label, "return -1;" directly ?
hero1985 2011-07-18
  • 打赏
  • 举报
回复
if(xxxx)
goto failed;

...
failed:
...
呆子毛 2011-07-14
  • 打赏
  • 举报
回复
use goto sentence? How to do it ?
hero1985 2011-07-14
  • 打赏
  • 举报
回复
when the driver probe failed,you should use goto sentence to remove module.

4,441

社区成员

发帖
与我相关
我的任务
社区描述
Linux/Unix社区 内核源代码研究区
社区管理员
  • 内核源代码研究区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧