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

Commit 9d08ba6d authored by Jia-Ju Bai's avatar Jia-Ju Bai Committed by Mauro Carvalho Chehab
Browse files

media: pci: cx88: Replace mdelay() with msleep() in dvb_register()



dvb_register() is never called in atomic context.
It calls mdelay() to busily wait, which is not necessary.
mdelay() can be replaced with msleep().

This is found by a static analysis tool named DCNS written by myself.

Signed-off-by: default avatarJia-Ju Bai <baijiaju1990@gmail.com>
Signed-off-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+samsung@kernel.org>
parent dddaf754
Loading
Loading
Loading
Loading
+10 −10
Original line number Original line Diff line number Diff line
@@ -1226,9 +1226,9 @@ static int dvb_register(struct cx8802_dev *dev)


		/* Do a hardware reset of chip before using it. */
		/* Do a hardware reset of chip before using it. */
		cx_clear(MO_GP0_IO, 1);
		cx_clear(MO_GP0_IO, 1);
		mdelay(100);
		msleep(100);
		cx_set(MO_GP0_IO, 1);
		cx_set(MO_GP0_IO, 1);
		mdelay(200);
		msleep(200);


		/* Select RF connector callback */
		/* Select RF connector callback */
		fusionhdtv_3_gold.pll_rf_set = lgdt330x_pll_rf_set;
		fusionhdtv_3_gold.pll_rf_set = lgdt330x_pll_rf_set;
@@ -1248,9 +1248,9 @@ static int dvb_register(struct cx8802_dev *dev)


		/* Do a hardware reset of chip before using it. */
		/* Do a hardware reset of chip before using it. */
		cx_clear(MO_GP0_IO, 1);
		cx_clear(MO_GP0_IO, 1);
		mdelay(100);
		msleep(100);
		cx_set(MO_GP0_IO, 9);
		cx_set(MO_GP0_IO, 9);
		mdelay(200);
		msleep(200);
		fe0->dvb.frontend = dvb_attach(lgdt330x_attach,
		fe0->dvb.frontend = dvb_attach(lgdt330x_attach,
					       &fusionhdtv_3_gold,
					       &fusionhdtv_3_gold,
					       0x0e,
					       0x0e,
@@ -1267,9 +1267,9 @@ static int dvb_register(struct cx8802_dev *dev)


		/* Do a hardware reset of chip before using it. */
		/* Do a hardware reset of chip before using it. */
		cx_clear(MO_GP0_IO, 1);
		cx_clear(MO_GP0_IO, 1);
		mdelay(100);
		msleep(100);
		cx_set(MO_GP0_IO, 1);
		cx_set(MO_GP0_IO, 1);
		mdelay(200);
		msleep(200);
		fe0->dvb.frontend = dvb_attach(lgdt330x_attach,
		fe0->dvb.frontend = dvb_attach(lgdt330x_attach,
					       &fusionhdtv_5_gold,
					       &fusionhdtv_5_gold,
					       0x0e,
					       0x0e,
@@ -1289,9 +1289,9 @@ static int dvb_register(struct cx8802_dev *dev)


		/* Do a hardware reset of chip before using it. */
		/* Do a hardware reset of chip before using it. */
		cx_clear(MO_GP0_IO, 1);
		cx_clear(MO_GP0_IO, 1);
		mdelay(100);
		msleep(100);
		cx_set(MO_GP0_IO, 1);
		cx_set(MO_GP0_IO, 1);
		mdelay(200);
		msleep(200);
		fe0->dvb.frontend = dvb_attach(lgdt330x_attach,
		fe0->dvb.frontend = dvb_attach(lgdt330x_attach,
					       &pchdtv_hd5500,
					       &pchdtv_hd5500,
					       0x59,
					       0x59,
@@ -1583,9 +1583,9 @@ static int dvb_register(struct cx8802_dev *dev)
		cx_set(MO_GP0_IO, 0x0101);
		cx_set(MO_GP0_IO, 0x0101);


		cx_clear(MO_GP0_IO, 0x01);
		cx_clear(MO_GP0_IO, 0x01);
		mdelay(100);
		msleep(100);
		cx_set(MO_GP0_IO, 0x01);
		cx_set(MO_GP0_IO, 0x01);
		mdelay(200);
		msleep(200);


		fe0->dvb.frontend = dvb_attach(stv0299_attach,
		fe0->dvb.frontend = dvb_attach(stv0299_attach,
					       &samsung_stv0299_config,
					       &samsung_stv0299_config,