staging: nvec: Fix usleep_range is preferred over udelay
Subsystems (3)
PATCH 1/1 staging: nvec: Fix usleep_range is preferred over udelay
This patch fixes the issue:
CHECK: usleep_range is preferred over udelay; seeDocumentation/timers/timers-howto.txt
--- drivers/staging/nvec/nvec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/nvec/nvec.c +1 -1
@@ -631,7 +631,7 @@ static irqreturn_t nvec_interrupt(int irq, void *dev)break ;case 2 :/* first byte after command */ if (status == (I2C_SL_IRQ |RNW |RCVD )) { -udelay (33 ); +usleep_range (30 ,35 );if (nvec->rx->data[0 ] !=0x01 ) {dev_err (nvec->dev,"Read without prior read command\n" );
Signature · 1 line
2.15.0
Quoted 17 lines · Joshua Abraham
Signed-off-by Joshua Abraham <[email protected]>This patch fixes the issue:
CHECK:
usleep_rangeis preferred over udelay; seeDocumentation/timers/timers-howto.txt--- drivers/staging/nvec/nvec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/staging/nvec/nvec.c +0
-0
drivers/staging/nvec/nvec.c static irqreturn_t nvec_interrupt(int irq, void *dev) · line 637
Quoted 8 lines
drivers/staging/nvec/nvec.c +1
-1@@ -631,7 +631,7 @@ static irqreturn_t nvec_interrupt(int irq, void *dev)break ;case 2 :/* first byte after command */ if (status == (I2C_SL_IRQ |RNW |RCVD )) { -udelay (33 ); +usleep_range (30 ,35 );if (nvec->rx->data[0 ] !=0x01 ) {dev_err (nvec->dev,"Read without prior read command\n" );
This is incorrect, as this function is an interrupt handler and we cannot sleep in interrupt context.
Cheers,
Mikko
Quoted 30 lines · Mikko Perttunen
Quoted 17 lines · Joshua Abraham
Signed-off-by Joshua Abraham <[email protected]>This patch fixes the issue:
CHECK:
usleep_rangeis preferred over udelay; seeDocumentation/timers/timers-howto.txt--- drivers/staging/nvec/nvec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/staging/nvec/nvec.c +0
-0drivers/staging/nvec/nvec.c static irqreturn_t nvec_interrupt(int irq, void *dev) · line 637
Quoted 8 lines
drivers/staging/nvec/nvec.c +1
-1@@ -631,7 +631,7 @@ static irqreturn_t nvec_interrupt(int irq, void *dev)break ;case 2 :/* first byte after command */ if (status == (I2C_SL_IRQ |RNW |RCVD )) { -udelay (33 ); +usleep_range (30 ,35 );if (nvec->rx->data[0 ] !=0x01 ) {dev_err (nvec->dev,"Read without prior read command\n" );This is incorrect, as this function is an interrupt handler and we cannot sleep in interrupt context.
Quoted 2 lines
Cheers,
Mikko
My mistake. Thank you for the feedback!
-Josh