MLK-22304-2 fbdev: mxsfb: fix build warnings if CONFIG_PM_SLEEP off
authorFancy Fang <chen.fang@nxp.com>
Tue, 23 Jul 2019 09:03:57 +0000 (17:03 +0800)
committerFancy Fang <chen.fang@nxp.com>
Wed, 24 Jul 2019 01:56:38 +0000 (09:56 +0800)
The system suspend and resume hooks is related with CONFIG_PM_SLEEP
instead of CONFIG_PM, so use CONFIG_PM_SLEEP to control the definitions
for them. And after this, the related overlay suspend and resume should
be defined under CONFIG_PM_SLEEP control. Below are the build warnings
before this patch.

drivers/video/fbdev/mxsfb.c:2463:12: warning: ‘mxsfb_resume’ defined but not used [-Wunused-function]
 static int mxsfb_resume(struct device *pdev)
            ^~~~~~~~~~~~
drivers/video/fbdev/mxsfb.c:2444:12: warning: ‘mxsfb_suspend’ defined but not used [-Wunused-function]
 static int mxsfb_suspend(struct device *pdev)
            ^~~~~~~~~~~~~

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
drivers/video/fbdev/mxsfb.c

index cd0b2f0..ac96d8e 100644 (file)
@@ -401,8 +401,6 @@ static const struct fb_bitfield def_rgb565[] = {
 };
 
 #ifdef CONFIG_FB_MXC_OVERLAY
-static u32 saved_as_ctrl;
-static u32 saved_as_next_buf;
 
 static const struct fb_bitfield def_argb555[] = {
        [RED] = {
@@ -2142,6 +2140,10 @@ static void mxsfb_overlay_exit(struct mxsfb_info *fbi)
        }
 }
 
+#ifdef CONFIG_PM_SLEEP
+static u32 saved_as_ctrl;
+static u32 saved_as_next_buf;
+
 static void mxsfb_overlay_resume(struct mxsfb_info *fbi)
 {
        if (fbi->cur_blank != FB_BLANK_UNBLANK) {
@@ -2181,11 +2183,11 @@ static void mxsfb_overlay_suspend(struct mxsfb_info *fbi)
                clk_disable_pix(fbi);
        }
 }
+#endif
+
 #else
 static void mxsfb_overlay_init(struct mxsfb_info *fbi) {}
 static void mxsfb_overlay_exit(struct mxsfb_info *fbi) {}
-static void mxsfb_overlay_resume(struct mxsfb_info *fbi) {}
-static void mxsfb_overlay_suspend(struct mxsfb_info *fbi) {}
 #endif
 
 static int mxsfb_probe(struct platform_device *pdev)
@@ -2440,7 +2442,9 @@ static int mxsfb_runtime_resume(struct device *dev)
 
        return 0;
 }
+#endif
 
+#ifdef CONFIG_PM_SLEEP
 static int mxsfb_suspend(struct device *pdev)
 {
        struct mxsfb_info *host = dev_get_drvdata(pdev);
@@ -2475,12 +2479,6 @@ static int mxsfb_resume(struct device *pdev)
 
        return 0;
 }
-#else
-#define        mxsfb_runtime_suspend   NULL
-#define        mxsfb_runtime_resume    NULL
-
-#define        mxsfb_suspend   NULL
-#define        mxsfb_resume    NULL
 #endif
 
 static const struct dev_pm_ops mxsfb_pm_ops = {