Skip to contentSkip to conversation

media: dvb/earth-pt1: fix wrong initialization for demod blocks

PATCH Akihiro TSUKADA 1 participant 1 message Feb 21, 2019 Media (V4L/DVB)

lore
Share & tools
lore
#0 lore raw

Hi,
thank you for reviewing my patch,
( <[email protected]>
https://patchwork.linuxtv.org/patch/53834/ ),
and excuse me for my late reply.
I somehow lost your mail and noticed it just today by checking Patchwork.

Quoted 15 lines · you

It might be possible to simplify the code a little by using strcmp() and making it into one loop, like so:

	for (i = 0; i < PT1_NR_ADAPS; i++) {
		cl = pt1->adaps[i]->demod_i2c_client;
		if (strcmp(cl->name, TC90522_I2C_DEV_SAT) &&
		    strcmp(cl->name, TC90522_I2C_DEV_TER)) 
			continue;

		ret = i2c_master_send(cl, buf, 2);
		if (ret < 0)
			return ret;

		usleep_range(30000, 50000);
	}

Any "cl" has the name of either TC90522_I2C_DEV_SAT or TC90522_I2C_DEV_TER, and no other name exists. (adaps[0],adaps[2]: _SAT, adaps[1],adaps[3]: _TER) The purpose of the code is to ensure that TER clients are processed BEFORE SAT clients, as noted in the header comment of this function. So I am afraid that unifying the two loops does not work.

--
Akihiro