summaryrefslogtreecommitdiffstats
path: root/drivers/auxdisplay/img-ascii-lcd.c
diff options
context:
space:
mode:
authorKees Cook <keescook@chromium.org>2017-10-19 14:08:22 -0700
committerKees Cook <keescook@chromium.org>2017-11-02 15:50:37 -0700
commit607a6301074fecfb855f08ecdd65b18d089e4143 (patch)
treefeb00f4a05700ff4db7fd96cc6250d6b388ccd4b /drivers/auxdisplay/img-ascii-lcd.c
parentdb275f2a02cd35d7a53564100ccf18ccb8a1130d (diff)
downloadlinux-stable-607a6301074fecfb855f08ecdd65b18d089e4143.tar.gz
linux-stable-607a6301074fecfb855f08ecdd65b18d089e4143.tar.bz2
linux-stable-607a6301074fecfb855f08ecdd65b18d089e4143.zip
auxdisplay: Convert timers to use timer_setup()
In preparation for unconditionally passing the struct timer_list pointer to all timer callbacks, switch to using the new timer_setup() and from_timer() to pass the timer pointer explicitly. Cc: Paul Burton <paul.burton@imgtec.com> Cc: Miguel Ojeda Sandonis <miguel.ojeda.sandonis@gmail.com> Signed-off-by: Kees Cook <keescook@chromium.org> Reviewed-by: Paul Burton <paul.burton@mips.com> Tested-by: Paul Burton <paul.burton@mips.com> # for img-ascii-lcd
Diffstat (limited to 'drivers/auxdisplay/img-ascii-lcd.c')
-rw-r--r--drivers/auxdisplay/img-ascii-lcd.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/drivers/auxdisplay/img-ascii-lcd.c b/drivers/auxdisplay/img-ascii-lcd.c
index 25306fa27251..c9e32d29ec81 100644
--- a/drivers/auxdisplay/img-ascii-lcd.c
+++ b/drivers/auxdisplay/img-ascii-lcd.c
@@ -229,9 +229,9 @@ MODULE_DEVICE_TABLE(of, img_ascii_lcd_matches);
* Scroll the current message along the LCD by one character, rearming the
* timer if required.
*/
-static void img_ascii_lcd_scroll(unsigned long arg)
+static void img_ascii_lcd_scroll(struct timer_list *t)
{
- struct img_ascii_lcd_ctx *ctx = (struct img_ascii_lcd_ctx *)arg;
+ struct img_ascii_lcd_ctx *ctx = from_timer(ctx, t, timer);
unsigned int i, ch = ctx->scroll_pos;
unsigned int num_chars = ctx->cfg->num_chars;
@@ -299,7 +299,7 @@ static int img_ascii_lcd_display(struct img_ascii_lcd_ctx *ctx,
ctx->scroll_pos = 0;
/* update the LCD */
- img_ascii_lcd_scroll((unsigned long)ctx);
+ img_ascii_lcd_scroll(&ctx->timer);
return 0;
}
@@ -395,9 +395,7 @@ static int img_ascii_lcd_probe(struct platform_device *pdev)
ctx->scroll_rate = HZ / 2;
/* initialise a timer for scrolling the message */
- init_timer(&ctx->timer);
- ctx->timer.function = img_ascii_lcd_scroll;
- ctx->timer.data = (unsigned long)ctx;
+ timer_setup(&ctx->timer, img_ascii_lcd_scroll, 0);
platform_set_drvdata(pdev, ctx);