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

Commit 7e3e68bc authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab
Browse files

[media] dvb_frontend: pass the props cache to get_frontend() as arg



Instead of using the DTV properties cache directly, pass the get
frontend data as an argument. For now, everything should remain
the same, but the next patch will prevent get_frontend to
affect the global cache.

This is needed because several drivers don't care enough to only
change the properties if locked. Due to that, calling
G_PROPERTY before locking on those drivers will make them to
never lock. Ok, those drivers are crap and should never be
merged like that, but the core should not rely that the drivers
would be doing the right thing.

Reviewed-by: default avatarMichael Ira Krufky <mkrufky@linuxtv.org>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@osg.samsung.com>
parent a7497049
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1361,7 +1361,7 @@ static int dtv_get_frontend(struct dvb_frontend *fe,
	int r;

	if (fe->ops.get_frontend) {
		r = fe->ops.get_frontend(fe);
		r = fe->ops.get_frontend(fe, c);
		if (unlikely(r < 0))
			return r;
		if (p_out)
+2 −1
Original line number Diff line number Diff line
@@ -449,7 +449,8 @@ struct dvb_frontend_ops {
	int (*set_frontend)(struct dvb_frontend *fe);
	int (*get_tune_settings)(struct dvb_frontend* fe, struct dvb_frontend_tune_settings* settings);

	int (*get_frontend)(struct dvb_frontend *fe);
	int (*get_frontend)(struct dvb_frontend *fe,
			    struct dtv_frontend_properties *props);

	int (*read_status)(struct dvb_frontend *fe, enum fe_status *status);
	int (*read_ber)(struct dvb_frontend* fe, u32* ber);
+2 −2
Original line number Diff line number Diff line
@@ -866,9 +866,9 @@ static int af9013_set_frontend(struct dvb_frontend *fe)
	return ret;
}

static int af9013_get_frontend(struct dvb_frontend *fe)
static int af9013_get_frontend(struct dvb_frontend *fe,
			       struct dtv_frontend_properties *c)
{
	struct dtv_frontend_properties *c = &fe->dtv_property_cache;
	struct af9013_state *state = fe->demodulator_priv;
	int ret;
	u8 buf[3];
+2 −2
Original line number Diff line number Diff line
@@ -691,10 +691,10 @@ static int af9033_set_frontend(struct dvb_frontend *fe)
	return ret;
}

static int af9033_get_frontend(struct dvb_frontend *fe)
static int af9033_get_frontend(struct dvb_frontend *fe,
			       struct dtv_frontend_properties *c)
{
	struct af9033_dev *dev = fe->demodulator_priv;
	struct dtv_frontend_properties *c = &fe->dtv_property_cache;
	int ret;
	u8 buf[8];

+2 −2
Original line number Diff line number Diff line
@@ -190,10 +190,10 @@ static int as102_fe_set_frontend(struct dvb_frontend *fe)
	return state->ops->set_tune(state->priv, &tune_args);
}

static int as102_fe_get_frontend(struct dvb_frontend *fe)
static int as102_fe_get_frontend(struct dvb_frontend *fe,
				 struct dtv_frontend_properties *c)
{
	struct as102_state *state = fe->demodulator_priv;
	struct dtv_frontend_properties *c = &fe->dtv_property_cache;
	int ret = 0;
	struct as10x_tps tps = { 0 };

Loading