staging: rts5208: use msecs_to_jiffies for timeouts
This is only an API consolidation and should make things more readable Converting milliseconds to jiffies by val * HZ / 1000 is technically not wrong but msecs_to_jiffies(val) is the cleaner solution and handles corner cases correctly. Signed-off-by: Nicholas Mc Guire <der.herr@hofr.at> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
a78d131265
commit
9df56d9bde
@ -271,7 +271,7 @@ int rtsx_send_cmd(struct rtsx_chip *chip, u8 card, int timeout)
|
|||||||
|
|
||||||
/* Wait for TRANS_OK_INT */
|
/* Wait for TRANS_OK_INT */
|
||||||
timeleft = wait_for_completion_interruptible_timeout(
|
timeleft = wait_for_completion_interruptible_timeout(
|
||||||
&trans_done, timeout * HZ / 1000);
|
&trans_done, msecs_to_jiffies(timeout));
|
||||||
if (timeleft <= 0) {
|
if (timeleft <= 0) {
|
||||||
dev_dbg(rtsx_dev(chip), "chip->int_reg = 0x%x\n",
|
dev_dbg(rtsx_dev(chip), "chip->int_reg = 0x%x\n",
|
||||||
chip->int_reg);
|
chip->int_reg);
|
||||||
@ -431,7 +431,7 @@ static int rtsx_transfer_sglist_adma_partial(struct rtsx_chip *chip, u8 card,
|
|||||||
spin_unlock_irq(&rtsx->reg_lock);
|
spin_unlock_irq(&rtsx->reg_lock);
|
||||||
|
|
||||||
timeleft = wait_for_completion_interruptible_timeout(
|
timeleft = wait_for_completion_interruptible_timeout(
|
||||||
&trans_done, timeout * HZ / 1000);
|
&trans_done, msecs_to_jiffies(timeout));
|
||||||
if (timeleft <= 0) {
|
if (timeleft <= 0) {
|
||||||
dev_dbg(rtsx_dev(chip), "Timeout (%s %d)\n",
|
dev_dbg(rtsx_dev(chip), "Timeout (%s %d)\n",
|
||||||
__func__, __LINE__);
|
__func__, __LINE__);
|
||||||
@ -455,7 +455,7 @@ static int rtsx_transfer_sglist_adma_partial(struct rtsx_chip *chip, u8 card,
|
|||||||
init_completion(&trans_done);
|
init_completion(&trans_done);
|
||||||
spin_unlock_irq(&rtsx->reg_lock);
|
spin_unlock_irq(&rtsx->reg_lock);
|
||||||
timeleft = wait_for_completion_interruptible_timeout(
|
timeleft = wait_for_completion_interruptible_timeout(
|
||||||
&trans_done, timeout * HZ / 1000);
|
&trans_done, msecs_to_jiffies(timeout));
|
||||||
if (timeleft <= 0) {
|
if (timeleft <= 0) {
|
||||||
dev_dbg(rtsx_dev(chip), "Timeout (%s %d)\n",
|
dev_dbg(rtsx_dev(chip), "Timeout (%s %d)\n",
|
||||||
__func__, __LINE__);
|
__func__, __LINE__);
|
||||||
@ -575,7 +575,7 @@ static int rtsx_transfer_sglist_adma(struct rtsx_chip *chip, u8 card,
|
|||||||
spin_unlock_irq(&rtsx->reg_lock);
|
spin_unlock_irq(&rtsx->reg_lock);
|
||||||
|
|
||||||
timeleft = wait_for_completion_interruptible_timeout(
|
timeleft = wait_for_completion_interruptible_timeout(
|
||||||
&trans_done, timeout * HZ / 1000);
|
&trans_done, msecs_to_jiffies(timeout));
|
||||||
if (timeleft <= 0) {
|
if (timeleft <= 0) {
|
||||||
dev_dbg(rtsx_dev(chip), "Timeout (%s %d)\n",
|
dev_dbg(rtsx_dev(chip), "Timeout (%s %d)\n",
|
||||||
__func__, __LINE__);
|
__func__, __LINE__);
|
||||||
@ -602,7 +602,7 @@ static int rtsx_transfer_sglist_adma(struct rtsx_chip *chip, u8 card,
|
|||||||
init_completion(&trans_done);
|
init_completion(&trans_done);
|
||||||
spin_unlock_irq(&rtsx->reg_lock);
|
spin_unlock_irq(&rtsx->reg_lock);
|
||||||
timeleft = wait_for_completion_interruptible_timeout(
|
timeleft = wait_for_completion_interruptible_timeout(
|
||||||
&trans_done, timeout * HZ / 1000);
|
&trans_done, msecs_to_jiffies(timeout));
|
||||||
if (timeleft <= 0) {
|
if (timeleft <= 0) {
|
||||||
dev_dbg(rtsx_dev(chip), "Timeout (%s %d)\n",
|
dev_dbg(rtsx_dev(chip), "Timeout (%s %d)\n",
|
||||||
__func__, __LINE__);
|
__func__, __LINE__);
|
||||||
@ -688,7 +688,7 @@ static int rtsx_transfer_buf(struct rtsx_chip *chip, u8 card, void *buf,
|
|||||||
|
|
||||||
/* Wait for TRANS_OK_INT */
|
/* Wait for TRANS_OK_INT */
|
||||||
timeleft = wait_for_completion_interruptible_timeout(
|
timeleft = wait_for_completion_interruptible_timeout(
|
||||||
&trans_done, timeout * HZ / 1000);
|
&trans_done, msecs_to_jiffies(timeout));
|
||||||
if (timeleft <= 0) {
|
if (timeleft <= 0) {
|
||||||
dev_dbg(rtsx_dev(chip), "Timeout (%s %d)\n",
|
dev_dbg(rtsx_dev(chip), "Timeout (%s %d)\n",
|
||||||
__func__, __LINE__);
|
__func__, __LINE__);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user