]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - drivers/auxdisplay/img-ascii-lcd.c
Merge remote-tracking branch 'tip/timers/core' into afs-next
[mirror_ubuntu-bionic-kernel.git] / drivers / auxdisplay / img-ascii-lcd.c
index a9020f82eea7139dbc0e3961c20c4e32f40dbb3a..db040b37822448fb75d1598d8d3a2657e9835644 100644 (file)
@@ -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);