mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-11 15:11:48 -04:00
radio: RTC6226: remove open and release v4l2_fh file
As part of v4l2_fh_open call at rtc6226 driver open time memory is allocated via kzalloc() and the same memory is not released at the time of rtc6226 driver open failure case. Remove the open and release v4l2_fh file as it not required for rtc6226 driver. Change-Id: I98195b9b0731d5392b82c3d12e393c6ffaad702c Signed-off-by: himta ram <hram@codeaurora.org>
This commit is contained in:
parent
a65504bf2b
commit
5499a4c2a7
1 changed files with 5 additions and 12 deletions
|
|
@ -523,13 +523,9 @@ static int rtc6226_fm_power_cfg(struct rtc6226_device *radio, bool powerflag)
|
|||
int rtc6226_fops_open(struct file *file)
|
||||
{
|
||||
struct rtc6226_device *radio = video_drvdata(file);
|
||||
int retval = v4l2_fh_open(file);
|
||||
int retval;
|
||||
|
||||
FMDBG("%s enter user num = %d\n", __func__, radio->users);
|
||||
if (retval) {
|
||||
FMDERR("%s fail to open v4l2\n", __func__);
|
||||
return retval;
|
||||
}
|
||||
if (atomic_inc_return(&radio->users) != 1) {
|
||||
FMDERR("Device already in use. Try again later\n");
|
||||
atomic_dec(&radio->users);
|
||||
|
|
@ -560,7 +556,6 @@ open_err_req_irq:
|
|||
rtc6226_fm_power_cfg(radio, TURNING_OFF);
|
||||
open_err_setup:
|
||||
atomic_dec(&radio->users);
|
||||
v4l2_fh_release(file);
|
||||
return retval;
|
||||
}
|
||||
|
||||
|
|
@ -573,18 +568,16 @@ int rtc6226_fops_release(struct file *file)
|
|||
int retval = 0;
|
||||
|
||||
FMDBG("%s : Exit\n", __func__);
|
||||
if (v4l2_fh_is_singular_file(file)) {
|
||||
if (radio->mode != FM_OFF) {
|
||||
rtc6226_power_down(radio);
|
||||
radio->mode = FM_OFF;
|
||||
}
|
||||
if (radio->mode != FM_OFF) {
|
||||
rtc6226_power_down(radio);
|
||||
radio->mode = FM_OFF;
|
||||
}
|
||||
rtc6226_disable_irq(radio);
|
||||
atomic_dec(&radio->users);
|
||||
retval = rtc6226_fm_power_cfg(radio, TURNING_OFF);
|
||||
if (retval < 0)
|
||||
FMDERR("%s: failed to apply voltage\n", __func__);
|
||||
return v4l2_fh_release(file);
|
||||
return retval;
|
||||
}
|
||||
|
||||
static int rtc6226_parse_dt(struct device *dev,
|
||||
|
|
|
|||
Loading…
Reference in a new issue