All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Leonardo Brás" <leobras.c@gmail.com>
To: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org
Subject: [PATCH v2 01/15] staging: fbtft: Changes udelay(n) to usleep_range(n, n + x). - Style
Date: Tue, 7 Aug 2018 21:28:00 -0300	[thread overview]
Message-ID: <355a96aa9bf3c29bbafc433a1b6e1662588250d8.1533686201.git.leobras.c@gmail.com> (raw)
In-Reply-To: <cover.1533686201.git.leobras.c@gmail.com>

Changes some udelay(n) for n >= 10 to usleep_range(n, n+x) as recommended by checkpatch.pl.

Signed-off-by: Leonardo Brás <leobras.c@gmail.com>
---
 drivers/staging/fbtft/fb_agm1264k-fl.c |  2 +-
 drivers/staging/fbtft/fb_ra8875.c      |  4 ++--
 drivers/staging/fbtft/fb_tinylcd.c     |  2 +-
 drivers/staging/fbtft/fb_upd161704.c   | 19 +++++++++----------
 drivers/staging/fbtft/fb_watterott.c   |  4 ++--
 5 files changed, 15 insertions(+), 16 deletions(-)

diff --git a/drivers/staging/fbtft/fb_agm1264k-fl.c b/drivers/staging/fbtft/fb_agm1264k-fl.c
index f6f30f5bf15a..7a24bde7ca8d 100644
--- a/drivers/staging/fbtft/fb_agm1264k-fl.c
+++ b/drivers/staging/fbtft/fb_agm1264k-fl.c
@@ -85,7 +85,7 @@ static void reset(struct fbtft_par *par)
 	dev_dbg(par->info->device, "%s()\n", __func__);
 
 	gpio_set_value(par->gpio.reset, 0);
-	udelay(20);
+	usleep_range(20, 25);
 	gpio_set_value(par->gpio.reset, 1);
 	mdelay(120);
 }
diff --git a/drivers/staging/fbtft/fb_ra8875.c b/drivers/staging/fbtft/fb_ra8875.c
index 5d3b76ca74d8..e2a62677b65b 100644
--- a/drivers/staging/fbtft/fb_ra8875.c
+++ b/drivers/staging/fbtft/fb_ra8875.c
@@ -217,7 +217,7 @@ static void write_reg8_bus8(struct fbtft_par *par, int len, ...)
 	}
 	len--;
 
-	udelay(100);
+	usleep_range(100, 101);
 
 	if (len) {
 		buf = (u8 *)par->buf;
@@ -238,7 +238,7 @@ static void write_reg8_bus8(struct fbtft_par *par, int len, ...)
 
 	/* restore user spi-speed */
 	par->fbtftops.write = fbtft_write_spi;
-	udelay(100);
+	usleep_range(100, 101);
 }
 
 static int write_vmem16_bus8(struct fbtft_par *par, size_t offset, size_t len)
diff --git a/drivers/staging/fbtft/fb_tinylcd.c b/drivers/staging/fbtft/fb_tinylcd.c
index e463b0ddf16d..3b2af1becca8 100644
--- a/drivers/staging/fbtft/fb_tinylcd.c
+++ b/drivers/staging/fbtft/fb_tinylcd.c
@@ -41,7 +41,7 @@ static int init_display(struct fbtft_par *par)
 			     0x00, 0x35, 0x33, 0x00, 0x00, 0x00);
 	write_reg(par, MIPI_DCS_SET_PIXEL_FORMAT, 0x55);
 	write_reg(par, MIPI_DCS_EXIT_SLEEP_MODE);
-	udelay(250);
+	usleep_range(250, 251);
 	write_reg(par, MIPI_DCS_SET_DISPLAY_ON);
 
 	return 0;
diff --git a/drivers/staging/fbtft/fb_upd161704.c b/drivers/staging/fbtft/fb_upd161704.c
index acc425fdf34e..10794f81b66e 100644
--- a/drivers/staging/fbtft/fb_upd161704.c
+++ b/drivers/staging/fbtft/fb_upd161704.c
@@ -36,27 +36,26 @@ static int init_display(struct fbtft_par *par)
 
 	/* oscillator start */
 	write_reg(par, 0x003A, 0x0001);	/*Oscillator 0: stop, 1: operation */
-	udelay(100);
-
+	usleep_range(100, 101);
 	/* y-setting */
 	write_reg(par, 0x0024, 0x007B);	/* amplitude setting */
-	udelay(10);
+	usleep_range(10, 11);
 	write_reg(par, 0x0025, 0x003B);	/* amplitude setting */
 	write_reg(par, 0x0026, 0x0034);	/* amplitude setting */
-	udelay(10);
+	usleep_range(10, 11);
 	write_reg(par, 0x0027, 0x0004);	/* amplitude setting */
 	write_reg(par, 0x0052, 0x0025);	/* circuit setting 1 */
-	udelay(10);
+	usleep_range(10, 11);
 	write_reg(par, 0x0053, 0x0033);	/* circuit setting 2 */
 	write_reg(par, 0x0061, 0x001C);	/* adjustment V10 positive polarity */
-	udelay(10);
+	usleep_range(10, 11);
 	write_reg(par, 0x0062, 0x002C);	/* adjustment V9 negative polarity */
 	write_reg(par, 0x0063, 0x0022);	/* adjustment V34 positive polarity */
-	udelay(10);
+	usleep_range(10, 11);
 	write_reg(par, 0x0064, 0x0027);	/* adjustment V31 negative polarity */
-	udelay(10);
+	usleep_range(10, 11);
 	write_reg(par, 0x0065, 0x0014);	/* adjustment V61 negative polarity */
-	udelay(10);
+	usleep_range(10, 11);
 	write_reg(par, 0x0066, 0x0010);	/* adjustment V61 negative polarity */
 
 	/* Basical clock for 1 line (BASECOUNT[7:0]) number specified */
@@ -64,7 +63,7 @@ static int init_display(struct fbtft_par *par)
 
 	/* Power supply setting */
 	write_reg(par, 0x0019, 0x0000);	/* DC/DC output setting */
-	udelay(200);
+	usleep_range(200, 201);
 	write_reg(par, 0x001A, 0x1000);	/* DC/DC frequency setting */
 	write_reg(par, 0x001B, 0x0023);	/* DC/DC rising setting */
 	write_reg(par, 0x001C, 0x0C01);	/* Regulator voltage setting */
diff --git a/drivers/staging/fbtft/fb_watterott.c b/drivers/staging/fbtft/fb_watterott.c
index bfd1527f20f7..9ad4307a50c8 100644
--- a/drivers/staging/fbtft/fb_watterott.c
+++ b/drivers/staging/fbtft/fb_watterott.c
@@ -83,7 +83,7 @@ static int write_vmem(struct fbtft_par *par, size_t offset, size_t len)
 			par->txbuf.buf, 10 + par->info->fix.line_length);
 		if (ret < 0)
 			return ret;
-		udelay(300);
+		usleep_range(300, 301);
 	}
 
 	return 0;
@@ -122,7 +122,7 @@ static int write_vmem_8bit(struct fbtft_par *par, size_t offset, size_t len)
 			par->txbuf.buf, 10 + par->info->var.xres);
 		if (ret < 0)
 			return ret;
-		udelay(700);
+		usleep_range(700, 701);
 	}
 
 	return 0;
-- 
2.18.0


  reply	other threads:[~2018-08-08  0:28 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-08  0:27 [PATCH v2 00/15] staging: fbtft: Fixes some issues found with checkpatch.pl Leonardo Brás
2018-08-08  0:28 ` Leonardo Brás [this message]
2018-08-08 12:18   ` [PATCH v2 01/15] staging: fbtft: Changes udelay(n) to usleep_range(n, n + x). - Style Greg Kroah-Hartman
2018-08-08  0:28 ` [PATCH v2 02/15] staging: fbtft: Puts macro arguments in parenthesis to avoid precedence issues " Leonardo Brás
2018-08-08  0:28 ` [PATCH v2 03/15] staging: fbtft: Fixes some alignment " Leonardo Brás
2018-08-08  0:28 ` [PATCH v2 04/15] staging: fbtft: Fixes some lines long lines (>80) " Leonardo Brás
2018-08-08 12:19   ` Greg Kroah-Hartman
2018-08-08  0:28 ` [PATCH v2 05/15] staging: fbtft: A bit more information on dev_err Leonardo Brás
2018-08-08  0:28 ` [PATCH v2 06/15] staging: fbtft: Changes gamma table to define Leonardo Brás
2018-08-08  0:29 ` [PATCH v2 07/15] staging: fbtft: Removes one nesting level to help readability - Style Leonardo Brás
2018-08-08  0:29 ` [PATCH v2 08/15] staging: fbtft: Adjust some empty-line problems " Leonardo Brás
2018-08-08  0:29 ` [PATCH v2 09/15] staging: fbtft: Erases some repetitive usage of function name " Leonardo Brás
2018-08-08  0:29 ` [PATCH v2 10/15] staging: fbtft: Fixes some defines styles " Leonardo Brás
2018-08-08 12:22   ` Greg Kroah-Hartman
     [not found]     ` <CADvQ+rGiF2kT62tBJjruGkQ8TbxU45PmgpW7xfrMy8xi1tOTBg@mail.gmail.com>
2018-08-09  9:49       ` Greg Kroah-Hartman
2018-08-08  0:29 ` [PATCH v2 11/15] staging: fbtft: Includes description to mutex and spinlock " Leonardo Brás
2018-08-08 12:22   ` Greg Kroah-Hartman
2018-08-08  0:29 ` [PATCH v2 12/15] staging: fbtft: Add spaces around / " Leonardo Brás
2018-08-08  0:29 ` [PATCH v2 13/15] staging: fbtft: Corrects long index line " Leonardo Brás
2018-08-08  0:30 ` [PATCH v2 14/15] staging: fbtft: Replaces (1 << n) for macro BIT(n) " Leonardo Brás
2018-08-08  0:30 ` [PATCH v2 15/15] staging: fbtft: Replaces custom debug macro with dev_dbg() Leonardo Brás
2018-08-08 12:24   ` Greg Kroah-Hartman

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=355a96aa9bf3c29bbafc433a1b6e1662588250d8.1533686201.git.leobras.c@gmail.com \
    --to=leobras.c@gmail.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=thomas.petazzoni@free-electrons.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.