static int users = 0;
static int radio_open(stuct video_device *dev, int flags)
{
if(users)
return -EBUSY;
users++;
MOD_INC_USE_COUNT;
return 0;
}
At open time we need to do nothing but check if someone else is also using the radio card. If nobody is
using it we make a note that we are using it, then we ensure that nobody unloads our driver on us.
static int radio_close(struct video_device *dev)
{
users-;
MOD_DEC_USE_COUNT;
}
阅读(574) | 评论(0) | 转发(0) |