diff options
Diffstat (limited to 'drivers/media/radio/radio-si470x.c')
-rw-r--r-- | drivers/media/radio/radio-si470x.c | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/drivers/media/radio/radio-si470x.c b/drivers/media/radio/radio-si470x.c index 16c7ef20265c..f6cedcd3ab97 100644 --- a/drivers/media/radio/radio-si470x.c +++ b/drivers/media/radio/radio-si470x.c | |||
@@ -986,7 +986,7 @@ static void si470x_work(struct work_struct *work) | |||
986 | static ssize_t si470x_fops_read(struct file *file, char __user *buf, | 986 | static ssize_t si470x_fops_read(struct file *file, char __user *buf, |
987 | size_t count, loff_t *ppos) | 987 | size_t count, loff_t *ppos) |
988 | { | 988 | { |
989 | struct si470x_device *radio = video_get_drvdata(video_devdata(file)); | 989 | struct si470x_device *radio = video_drvdata(file); |
990 | int retval = 0; | 990 | int retval = 0; |
991 | unsigned int block_count = 0; | 991 | unsigned int block_count = 0; |
992 | 992 | ||
@@ -1047,7 +1047,7 @@ done: | |||
1047 | static unsigned int si470x_fops_poll(struct file *file, | 1047 | static unsigned int si470x_fops_poll(struct file *file, |
1048 | struct poll_table_struct *pts) | 1048 | struct poll_table_struct *pts) |
1049 | { | 1049 | { |
1050 | struct si470x_device *radio = video_get_drvdata(video_devdata(file)); | 1050 | struct si470x_device *radio = video_drvdata(file); |
1051 | int retval = 0; | 1051 | int retval = 0; |
1052 | 1052 | ||
1053 | /* switch on rds reception */ | 1053 | /* switch on rds reception */ |
@@ -1071,9 +1071,10 @@ static unsigned int si470x_fops_poll(struct file *file, | |||
1071 | */ | 1071 | */ |
1072 | static int si470x_fops_open(struct inode *inode, struct file *file) | 1072 | static int si470x_fops_open(struct inode *inode, struct file *file) |
1073 | { | 1073 | { |
1074 | struct si470x_device *radio = video_get_drvdata(video_devdata(file)); | 1074 | struct si470x_device *radio = video_drvdata(file); |
1075 | int retval; | 1075 | int retval; |
1076 | 1076 | ||
1077 | lock_kernel(); | ||
1077 | radio->users++; | 1078 | radio->users++; |
1078 | 1079 | ||
1079 | retval = usb_autopm_get_interface(radio->intf); | 1080 | retval = usb_autopm_get_interface(radio->intf); |
@@ -1090,6 +1091,7 @@ static int si470x_fops_open(struct inode *inode, struct file *file) | |||
1090 | } | 1091 | } |
1091 | 1092 | ||
1092 | done: | 1093 | done: |
1094 | unlock_kernel(); | ||
1093 | return retval; | 1095 | return retval; |
1094 | } | 1096 | } |
1095 | 1097 | ||
@@ -1099,7 +1101,7 @@ done: | |||
1099 | */ | 1101 | */ |
1100 | static int si470x_fops_release(struct inode *inode, struct file *file) | 1102 | static int si470x_fops_release(struct inode *inode, struct file *file) |
1101 | { | 1103 | { |
1102 | struct si470x_device *radio = video_get_drvdata(video_devdata(file)); | 1104 | struct si470x_device *radio = video_drvdata(file); |
1103 | int retval = 0; | 1105 | int retval = 0; |
1104 | 1106 | ||
1105 | /* safety check */ | 1107 | /* safety check */ |
@@ -1282,7 +1284,7 @@ done: | |||
1282 | static int si470x_vidioc_g_ctrl(struct file *file, void *priv, | 1284 | static int si470x_vidioc_g_ctrl(struct file *file, void *priv, |
1283 | struct v4l2_control *ctrl) | 1285 | struct v4l2_control *ctrl) |
1284 | { | 1286 | { |
1285 | struct si470x_device *radio = video_get_drvdata(video_devdata(file)); | 1287 | struct si470x_device *radio = video_drvdata(file); |
1286 | int retval = 0; | 1288 | int retval = 0; |
1287 | 1289 | ||
1288 | /* safety checks */ | 1290 | /* safety checks */ |
@@ -1318,7 +1320,7 @@ done: | |||
1318 | static int si470x_vidioc_s_ctrl(struct file *file, void *priv, | 1320 | static int si470x_vidioc_s_ctrl(struct file *file, void *priv, |
1319 | struct v4l2_control *ctrl) | 1321 | struct v4l2_control *ctrl) |
1320 | { | 1322 | { |
1321 | struct si470x_device *radio = video_get_drvdata(video_devdata(file)); | 1323 | struct si470x_device *radio = video_drvdata(file); |
1322 | int retval = 0; | 1324 | int retval = 0; |
1323 | 1325 | ||
1324 | /* safety checks */ | 1326 | /* safety checks */ |
@@ -1405,7 +1407,7 @@ done: | |||
1405 | static int si470x_vidioc_g_tuner(struct file *file, void *priv, | 1407 | static int si470x_vidioc_g_tuner(struct file *file, void *priv, |
1406 | struct v4l2_tuner *tuner) | 1408 | struct v4l2_tuner *tuner) |
1407 | { | 1409 | { |
1408 | struct si470x_device *radio = video_get_drvdata(video_devdata(file)); | 1410 | struct si470x_device *radio = video_drvdata(file); |
1409 | int retval = 0; | 1411 | int retval = 0; |
1410 | 1412 | ||
1411 | /* safety checks */ | 1413 | /* safety checks */ |
@@ -1471,7 +1473,7 @@ done: | |||
1471 | static int si470x_vidioc_s_tuner(struct file *file, void *priv, | 1473 | static int si470x_vidioc_s_tuner(struct file *file, void *priv, |
1472 | struct v4l2_tuner *tuner) | 1474 | struct v4l2_tuner *tuner) |
1473 | { | 1475 | { |
1474 | struct si470x_device *radio = video_get_drvdata(video_devdata(file)); | 1476 | struct si470x_device *radio = video_drvdata(file); |
1475 | int retval = 0; | 1477 | int retval = 0; |
1476 | 1478 | ||
1477 | /* safety checks */ | 1479 | /* safety checks */ |
@@ -1505,7 +1507,7 @@ done: | |||
1505 | static int si470x_vidioc_g_frequency(struct file *file, void *priv, | 1507 | static int si470x_vidioc_g_frequency(struct file *file, void *priv, |
1506 | struct v4l2_frequency *freq) | 1508 | struct v4l2_frequency *freq) |
1507 | { | 1509 | { |
1508 | struct si470x_device *radio = video_get_drvdata(video_devdata(file)); | 1510 | struct si470x_device *radio = video_drvdata(file); |
1509 | int retval = 0; | 1511 | int retval = 0; |
1510 | 1512 | ||
1511 | /* safety checks */ | 1513 | /* safety checks */ |
@@ -1534,7 +1536,7 @@ done: | |||
1534 | static int si470x_vidioc_s_frequency(struct file *file, void *priv, | 1536 | static int si470x_vidioc_s_frequency(struct file *file, void *priv, |
1535 | struct v4l2_frequency *freq) | 1537 | struct v4l2_frequency *freq) |
1536 | { | 1538 | { |
1537 | struct si470x_device *radio = video_get_drvdata(video_devdata(file)); | 1539 | struct si470x_device *radio = video_drvdata(file); |
1538 | int retval = 0; | 1540 | int retval = 0; |
1539 | 1541 | ||
1540 | /* safety checks */ | 1542 | /* safety checks */ |
@@ -1563,7 +1565,7 @@ done: | |||
1563 | static int si470x_vidioc_s_hw_freq_seek(struct file *file, void *priv, | 1565 | static int si470x_vidioc_s_hw_freq_seek(struct file *file, void *priv, |
1564 | struct v4l2_hw_freq_seek *seek) | 1566 | struct v4l2_hw_freq_seek *seek) |
1565 | { | 1567 | { |
1566 | struct si470x_device *radio = video_get_drvdata(video_devdata(file)); | 1568 | struct si470x_device *radio = video_drvdata(file); |
1567 | int retval = 0; | 1569 | int retval = 0; |
1568 | 1570 | ||
1569 | /* safety checks */ | 1571 | /* safety checks */ |