Skip to content

Commit

Permalink
pcmcia: pcmcia_resource: Replace mdelay() with msleep()
Browse files Browse the repository at this point in the history
pcmcia_fixup_iowidth() and pcmcia_enable_device() are
never called in atomic context.
They call 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: Jia-Ju Bai <[email protected]>
Signed-off-by: Dominik Brodowski <[email protected]>
  • Loading branch information
XidianGeneral authored and Dominik Brodowski committed Oct 1, 2018
1 parent 5f17af0 commit 1b22dcf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/pcmcia/pcmcia_resource.c
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ int pcmcia_fixup_iowidth(struct pcmcia_device *p_dev)
io_on.stop = s->io[i].res->end;

s->ops->set_io_map(s, &io_off);
mdelay(40);
msleep(40);
s->ops->set_io_map(s, &io_on);
}
unlock:
Expand Down Expand Up @@ -567,7 +567,7 @@ int pcmcia_enable_device(struct pcmcia_device *p_dev)
!(flags & CONF_ENABLE_PULSE_IRQ))
option |= COR_LEVEL_REQ;
pcmcia_write_cis_mem(s, 1, (base + CISREG_COR)>>1, 1, &option);
mdelay(40);
msleep(40);
}
if (p_dev->config_regs & PRESENT_STATUS)
pcmcia_write_cis_mem(s, 1, (base + CISREG_CCSR)>>1, 1, &status);
Expand Down

0 comments on commit 1b22dcf

Please sign in to comment.