UPSTREAM: thermal: rockchip: improve the warning log
authorShawn Lin <shawn.lin@rock-chips.com>
Tue, 11 Oct 2016 02:07:34 +0000 (10:07 +0800)
committerCaesar Wang <wxt@rock-chips.com>
Tue, 22 Nov 2016 03:40:27 +0000 (11:40 +0800)
It is no necessary to print warning agian and again if we don't
add rockchip,grf for dt, otherwise I saw the following log when
doing suspend-2-resume. We only need to print it once when parsing
dt. It looks quite trivial but the log is apparently verbose.

[   26.615415] PM: early resume of devices complete after 1.539 msecs
[   26.622002] rk_tsadcv2_initialize: Missing rockchip,grf property
[   26.629359] rk_gmac-dwmac ff290000.ethernet: init for RGMII
[   26.639794] PM: resume of devices complete after 18.109 msecs
[   26.646925] Restarting tasks ... done.

Change-Id: Ia3124f557e2b4f47c691671d27ea6a0f136f3f6f
Reviewed-by: Caesar Wang <wxt@rock-chips.com>
Reviewed-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
Signed-off-by: Eduardo Valentin <edubezval@gmail.com>
Signed-off-by: Caesar Wang <wxt@rock-chips.com>
(cherry picked from git.kernel.org evalenti/linux-soc-thermal.git next
 commit 947d62b53ff381d1ca4b3288b53a26c6d38957aa)

drivers/thermal/rockchip_thermal.c

index 357d967fc71fa4c679ebaddf49926d543827a062..fb68b748a6b0405b94e2da10f74817f06c803b8d 100644 (file)
@@ -525,11 +525,6 @@ static void rk_tsadcv2_initialize(struct regmap *grf, void __iomem *regs,
                       regs + TSADCV2_AUTO_PERIOD_HT);
        writel_relaxed(TSADCV2_HIGHT_TSHUT_DEBOUNCE_COUNT,
                       regs + TSADCV2_HIGHT_TSHUT_DEBOUNCE);
-
-       if (IS_ERR(grf)) {
-               pr_warn("%s: Missing rockchip,grf property\n", __func__);
-               return;
-       }
 }
 
 /**
@@ -969,6 +964,8 @@ static int rockchip_configure_from_dt(struct device *dev,
         * need this property.
         */
        thermal->grf = syscon_regmap_lookup_by_phandle(np, "rockchip,grf");
+       if (IS_ERR(thermal->grf))
+               dev_warn(dev, "Missing rockchip,grf property\n");
 
        return 0;
 }