int retval = 0;
/* safety checks */
- if (radio->disconnected) {
- retval = -EIO;
+ retval = si470x_disconnect_check(radio);
+ if (retval)
goto done;
- }
switch (ctrl->id) {
case V4L2_CID_AUDIO_VOLUME:
int retval = 0;
/* safety checks */
- if (radio->disconnected) {
- retval = -EIO;
+ retval = si470x_disconnect_check(radio);
+ if (retval)
goto done;
- }
switch (ctrl->id) {
case V4L2_CID_AUDIO_VOLUME:
int retval = 0;
/* safety checks */
- if (radio->disconnected) {
- retval = -EIO;
+ retval = si470x_disconnect_check(radio);
+ if (retval)
goto done;
- }
+
if (tuner->index != 0) {
retval = -EINVAL;
goto done;
int retval = -EINVAL;
/* safety checks */
- if (radio->disconnected) {
- retval = -EIO;
+ retval = si470x_disconnect_check(radio);
+ if (retval)
goto done;
- }
+
if (tuner->index != 0)
goto done;
int retval = 0;
/* safety checks */
- if (radio->disconnected) {
- retval = -EIO;
+ retval = si470x_disconnect_check(radio);
+ if (retval)
goto done;
- }
+
if (freq->tuner != 0) {
retval = -EINVAL;
goto done;
int retval = 0;
/* safety checks */
- if (radio->disconnected) {
- retval = -EIO;
+ retval = si470x_disconnect_check(radio);
+ if (retval)
goto done;
- }
+
if (freq->tuner != 0) {
retval = -EINVAL;
goto done;
int retval = 0;
/* safety checks */
- if (radio->disconnected) {
- retval = -EIO;
+ retval = si470x_disconnect_check(radio);
+ if (retval)
goto done;
- }
+
if (seek->tuner != 0) {
retval = -EINVAL;
goto done;
+/**************************************************************************
+ * General Driver Functions - DISCONNECT_CHECK
+ **************************************************************************/
+
+/*
+ * si470x_disconnect_check - check whether radio disconnects
+ */
+int si470x_disconnect_check(struct si470x_device *radio)
+{
+ if (radio->disconnected)
+ return -EIO;
+ else
+ return 0;
+}
+
+
+
/**************************************************************************
* RDS Driver Functions
**************************************************************************/
extern struct video_device si470x_viddev_template;
int si470x_get_register(struct si470x_device *radio, int regnr);
int si470x_set_register(struct si470x_device *radio, int regnr);
+int si470x_disconnect_check(struct si470x_device *radio);
int si470x_set_freq(struct si470x_device *radio, unsigned int freq);
int si470x_start(struct si470x_device *radio);
int si470x_stop(struct si470x_device *radio);