From 5499a4c2a75ceea8430aa8573d5ecec3a8e3e0dd Mon Sep 17 00:00:00 2001 From: himta ram Date: Tue, 28 Apr 2020 10:34:37 +0530 Subject: [PATCH] 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 --- drivers/media/radio/rtc6226/radio-rtc6226-i2c.c | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/drivers/media/radio/rtc6226/radio-rtc6226-i2c.c b/drivers/media/radio/rtc6226/radio-rtc6226-i2c.c index eb8461f606b9..2eec3b52b8ac 100644 --- a/drivers/media/radio/rtc6226/radio-rtc6226-i2c.c +++ b/drivers/media/radio/rtc6226/radio-rtc6226-i2c.c @@ -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,