From the author:
"This fixes the problem where previously all client disconnects
put the analogue frontend into standby.
In the following example, the first command is succesfully
watching TV but the second command which returns EBUSY
detunes the receiver by entering it into the standby state.
tvtime -d /dev/video0 &
cat /dev/video0
"
Signed-off-by: Steven Toth <stoth@linuxtv.org>
Signed-off-by: Darron Broad <darron@kewl.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
}
unlock_kernel();
+ atomic_inc(&core->users);
+
return 0;
}
file->private_data = NULL;
kfree(fh);
- cx88_call_i2c_clients (dev->core, TUNER_SET_STANDBY, NULL);
+ if(atomic_dec_and_test(&dev->core->users))
+ cx88_call_i2c_clients (dev->core, TUNER_SET_STANDBY, NULL);
return 0;
}
struct mutex lock;
/* various v4l controls */
u32 freq;
+ atomic_t users;
/* cx88-video needs to access cx8802 for hybrid tuner pll access. */
struct cx8802_dev *dvbdev;