Merge tag 'auxdisplay-for-linus-v4.19' of git://github.com/ojeda/linux
authorLinus Torvalds <torvalds@linux-foundation.org>
Thu, 16 Aug 2018 02:23:24 +0000 (19:23 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 16 Aug 2018 02:23:24 +0000 (19:23 -0700)
Pull auxdisplay updates from Miguel Ojeda:
 "Two cleanups for char_lcd:

   - simplify getting .drvdata (Wolfram Sang)

   - delete mdelay in long_sleep (Jia-Ju Bai)"

* tag 'auxdisplay-for-linus-v4.19' of git://github.com/ojeda/linux:
  auxdisplay: simplify getting .drvdata
  auxdisplay: charlcd: delete mdelay in long_sleep

drivers/auxdisplay/arm-charlcd.c
drivers/auxdisplay/charlcd.c

index 296fb30dfa006567c75715cb985e1c4a15c592f2..dea031484cc4874a4ccad0f47b45ff5208a05088 100644 (file)
@@ -331,8 +331,7 @@ out_no_resource:
 
 static int charlcd_suspend(struct device *dev)
 {
-       struct platform_device *pdev = to_platform_device(dev);
-       struct charlcd *lcd = platform_get_drvdata(pdev);
+       struct charlcd *lcd = dev_get_drvdata(dev);
 
        /* Power the display off */
        charlcd_4bit_command(lcd, HD_DISPCTRL);
@@ -341,8 +340,7 @@ static int charlcd_suspend(struct device *dev)
 
 static int charlcd_resume(struct device *dev)
 {
-       struct platform_device *pdev = to_platform_device(dev);
-       struct charlcd *lcd = platform_get_drvdata(pdev);
+       struct charlcd *lcd = dev_get_drvdata(dev);
 
        /* Turn the display back on */
        charlcd_4bit_command(lcd, HD_DISPCTRL | HD_DISPCTRL_ON);
index 8673fc2b9eb8705b01711185a9f5aec63d63c846..81c22d20d9d9c568ffc2f6c191a407baee330719 100644 (file)
@@ -99,10 +99,7 @@ static atomic_t charlcd_available = ATOMIC_INIT(1);
 /* sleeps that many milliseconds with a reschedule */
 static void long_sleep(int ms)
 {
-       if (in_interrupt())
-               mdelay(ms);
-       else
-               schedule_timeout_interruptible(msecs_to_jiffies(ms));
+       schedule_timeout_interruptible(msecs_to_jiffies(ms));
 }
 
 /* turn the backlight on or off */