linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Brian Masney <masneyb@onstation.org>
To: jic23@kernel.org
Cc: gregkh@linuxfoundation.org, linux-iio@vger.kernel.org,
	devel@driverdev.osuosl.org, knaack.h@gmx.de, lars@metafoo.de,
	pmeerw@pmeerw.net, linux-kernel@vger.kernel.org,
	ldewangan@nvidia.com
Subject: [PATCH 1/7] staging: iio: isl29028: change mdelay() to msleep()
Date: Wed,  8 Feb 2017 20:54:25 -0500	[thread overview]
Message-ID: <20170209015431.17380-2-masneyb@onstation.org> (raw)
In-Reply-To: <20170209015431.17380-1-masneyb@onstation.org>

This driver in some cases can busy wait for upwards of 100 ms. Since the
kernel at this point is not running in atomic context, and is running in
process context, we can safely use msleep() instead. This patch changes
the two occurrences of mdelay() to msleep().

Signed-off-by: Brian Masney <masneyb@onstation.org>
---
 drivers/staging/iio/light/isl29028.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/iio/light/isl29028.c b/drivers/staging/iio/light/isl29028.c
index 6bb6d37..8dc24c94 100644
--- a/drivers/staging/iio/light/isl29028.c
+++ b/drivers/staging/iio/light/isl29028.c
@@ -121,7 +121,7 @@ static int isl29028_enable_proximity(struct isl29028_chip *chip)
 		return ret;
 
 	/* Wait for conversion to be complete for first sample */
-	mdelay(DIV_ROUND_UP(1000, chip->prox_sampling));
+	msleep(DIV_ROUND_UP(1000, chip->prox_sampling));
 
 	return 0;
 }
@@ -192,7 +192,7 @@ static int isl29028_set_als_ir_mode(struct isl29028_chip *chip,
 		return ret;
 
 	/* Need to wait for conversion time if ALS/IR mode enabled */
-	mdelay(ISL29028_CONV_TIME_MS);
+	msleep(ISL29028_CONV_TIME_MS);
 
 	chip->als_ir_mode = mode;
 
-- 
2.9.3

  reply	other threads:[~2017-02-09  1:56 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-09  1:54 [PATCH 0/7] iio: isl29028: move out of staging Brian Masney
2017-02-09  1:54 ` Brian Masney [this message]
2017-02-11  9:41   ` [PATCH 1/7] staging: iio: isl29028: change mdelay() to msleep() Jonathan Cameron
2017-02-09  1:54 ` [PATCH 2/7] staging: iio: isl29028: fix incorrect sleep time when taking initial proximity reading Brian Masney
2017-02-11  9:40   ` Jonathan Cameron
2017-02-09  1:54 ` [PATCH 3/7] staging: iio: isl29028: fix incorrect sampling frequency value Brian Masney
2017-02-11  9:44   ` Jonathan Cameron
2017-02-09  1:54 ` [PATCH 4/7] staging: iio: isl29028: use the runtime power management for system sleep Brian Masney
2017-02-11  9:47   ` Jonathan Cameron
2017-02-09  1:54 ` [PATCH 5/7] staging: iio: isl29028: add copyright Brian Masney
2017-02-11  9:49   ` Jonathan Cameron
2017-02-09  1:54 ` [PATCH 6/7] iio: Documentation: add ABI documentation for in_proximity_sampling_frequency_available Brian Masney
2017-02-11  9:50   ` Jonathan Cameron
2017-02-09  1:54 ` [PATCH 7/7] staging: iio: isl29028: move out of staging Brian Masney
2017-02-11  9:54   ` Jonathan Cameron

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170209015431.17380-2-masneyb@onstation.org \
    --to=masneyb@onstation.org \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=jic23@kernel.org \
    --cc=knaack.h@gmx.de \
    --cc=lars@metafoo.de \
    --cc=ldewangan@nvidia.com \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pmeerw@pmeerw.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).