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

Commit e1ace966 authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "radio: RTC6226: remove open and release v4l2_fh file"

parents 67038a08 a59ce345
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,