Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
fork

Configure Feed

Select the types of activity you want to include in your feed.

OMAP: DSS2: Make check-delay-loops consistent

Loops checking for certain condition were rather inconsistent.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@nokia.com>
Reported-by: Juha Leppanen <juha_motorsportcom@luukku.com>

+10 -10
+7 -7
drivers/video/omap2/dss/dsi.c
··· 828 828 829 829 /* PLL_PWR_STATUS */ 830 830 while (FLD_GET(dsi_read_reg(DSI_CLK_CTRL), 29, 28) != state) { 831 - udelay(1); 832 - if (t++ > 1000) { 831 + if (++t > 1000) { 833 832 DSSERR("Failed to set DSI PLL power mode to %d\n", 834 833 state); 835 834 return -ENODEV; 836 835 } 836 + udelay(1); 837 837 } 838 838 839 839 return 0; ··· 1441 1441 1442 1442 /* PWR_STATUS */ 1443 1443 while (FLD_GET(dsi_read_reg(DSI_COMPLEXIO_CFG1), 26, 25) != state) { 1444 - udelay(1); 1445 - if (t++ > 1000) { 1444 + if (++t > 1000) { 1446 1445 DSSERR("failed to set complexio power state to " 1447 1446 "%d\n", state); 1448 1447 return -ENODEV; 1449 1448 } 1449 + udelay(1); 1450 1450 } 1451 1451 1452 1452 return 0; ··· 1646 1646 1647 1647 static int _dsi_wait_reset(void) 1648 1648 { 1649 - int i = 0; 1649 + int t = 0; 1650 1650 1651 1651 while (REG_GET(DSI_SYSSTATUS, 0, 0) == 0) { 1652 - if (i++ > 5) { 1652 + if (++t > 5) { 1653 1653 DSSERR("soft reset failed\n"); 1654 1654 return -ENODEV; 1655 1655 } ··· 2706 2706 /* using fifo not empty */ 2707 2707 /* TX_FIFO_NOT_EMPTY */ 2708 2708 while (FLD_GET(dsi_read_reg(DSI_VC_CTRL(0)), 5, 5)) { 2709 - udelay(1); 2710 2709 fifo_stalls++; 2711 2710 if (fifo_stalls > 0xfffff) { 2712 2711 DSSERR("fifo stalls overflow, pixels left %d\n", ··· 2713 2714 dsi_if_enable(0); 2714 2715 return -EIO; 2715 2716 } 2717 + udelay(1); 2716 2718 } 2717 2719 #elif 1 2718 2720 /* using fifo emptiness */
+3 -3
drivers/video/omap2/dss/dss.c
··· 467 467 468 468 static int _omap_dss_wait_reset(void) 469 469 { 470 - unsigned timeout = 1000; 470 + int t = 0; 471 471 472 472 while (REG_GET(DSS_SYSSTATUS, 0, 0) == 0) { 473 - udelay(1); 474 - if (!--timeout) { 473 + if (++t > 1000) { 475 474 DSSERR("soft reset failed\n"); 476 475 return -ENODEV; 477 476 } 477 + udelay(1); 478 478 } 479 479 480 480 return 0;