]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
staging: fbtft: fb_tinylcd: replace udelay() with fsleep()
authorTomasz Unger <tomasz.unger@yahoo.pl>
Thu, 19 Feb 2026 14:29:42 +0000 (15:29 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 23 Feb 2026 14:43:56 +0000 (15:43 +0100)
fsleep() is the preferred modern API for flexible sleeping as it
automatically selects the best sleep mechanism based on the duration.
Replace udelay() with fsleep() to improve power efficiency.

init_display() is a driver initialization callback which runs in
sleeping context, so fsleep() is safe to use here.

Signed-off-by: Tomasz Unger <tomasz.unger@yahoo.pl>
Acked-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Link: https://patch.msgid.link/20260219142942.74087-1-tomasz.unger@yahoo.pl
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/fbtft/fb_tinylcd.c

index fc17e3c687fbbb3ca747e08b43e425d7521ff1db..afa8f1c740c568ae675ab1e658c73e75edbf3b8b 100644 (file)
@@ -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);
+       fsleep(250);
        write_reg(par, MIPI_DCS_SET_DISPLAY_ON);
 
        return 0;