Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a59ce345 authored by himta ram's avatar himta ram Committed by Gerrit - the friendly Code Review server
Browse files

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.

CRs-Fixed: 2669443
Change-Id: I98195b9b0731d5392b82c3d12e393c6ffaad702c
Signed-off-by: default avatarhimta ram <hram@codeaurora.org>
parent 5537f3dc
Loading
Loading
Loading
Loading
+5 −12
Original line number Diff line number Diff line
@@ -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 @@ int rtc6226_fops_open(struct file *file)
	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;
	}
	}
	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,