]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
video: squash lines for immediate return
authorMasahiro Yamada <yamada.masahiro@socionext.com>
Tue, 6 Sep 2016 13:17:33 +0000 (22:17 +0900)
committerTom Rini <trini@konsulko.com>
Fri, 23 Sep 2016 21:53:45 +0000 (17:53 -0400)
For vidconsole_post_probe(), it is common coding style to let a
probe method return the value of a register function.

The others will become simple wrapper functions.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Acked-by: Anatolij Gustschin <agust@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Acked-by: Stephen Warren <swarren@nvidia.com>
drivers/video/bridge/ptn3460.c
drivers/video/broadwell_igd.c
drivers/video/exynos/exynos_dp_lowlevel.c
drivers/video/tegra124/display.c
drivers/video/vidconsole-uclass.c

index 2e2ae7c5a6144869cb0947a4b394ffc09fa707cb..f9d3720c8f7ef5780e253a05c158cf6f04025858 100644 (file)
 
 static int ptn3460_attach(struct udevice *dev)
 {
-       int ret;
-
        debug("%s: %s\n", __func__, dev->name);
-       ret = video_bridge_set_active(dev, true);
-       if (ret)
-               return ret;
 
-       return 0;
+       return video_bridge_set_active(dev, true);
 }
 
 struct video_bridge_ops ptn3460_ops = {
index ce4f296d0a001bd1162e1a0a8f65ccbfb20821f4..4286fd0648b786e6c2835b16c17f3f8796ff1302 100644 (file)
@@ -323,10 +323,7 @@ err:
 static unsigned long gtt_read(struct broadwell_igd_priv *priv,
                              unsigned long reg)
 {
-       u32 val;
-
-       val = readl(priv->regs + reg);
-       return val;
+       return readl(priv->regs + reg);
 }
 
 static void gtt_write(struct broadwell_igd_priv *priv, unsigned long reg,
index f9784738bb959d4db604b9d01d69594e0eca9a42..aae78a8159ca9f73ea61bcc5ae6d944a6344e359 100644 (file)
@@ -881,11 +881,7 @@ void exynos_dp_set_lane_count(struct exynos_dp *dp_regs, unsigned char count)
 
 unsigned int exynos_dp_get_lane_count(struct exynos_dp *dp_regs)
 {
-       unsigned int reg;
-
-       reg = readl(&dp_regs->lane_count_set);
-
-       return reg;
+       return readl(&dp_regs->lane_count_set);
 }
 
 unsigned char exynos_dp_get_lanex_pre_emphasis(struct exynos_dp *dp_regs,
index 2f1f0df20eb194e557697a9d70761cfda9f7047f..d8999c3c6824954601e559f7c685a594cf08dfbf 100644 (file)
@@ -326,13 +326,7 @@ static int display_update_config_from_edid(struct udevice *dp_dev,
                                           int *panel_bppp,
                                           struct display_timing *timing)
 {
-       int ret;
-
-       ret = display_read_timing(dp_dev, timing);
-       if (ret)
-               return ret;
-
-       return 0;
+       return display_read_timing(dp_dev, timing);
 }
 
 static int display_init(struct udevice *dev, void *lcdbase,
index c8cc05e3c2ab47addda1467adc9164a47153a672..e9a90b1b9bc375137cb93d4bdb1efa1ad6f66e4f 100644 (file)
@@ -190,7 +190,6 @@ static int vidconsole_post_probe(struct udevice *dev)
 {
        struct vidconsole_priv *priv = dev_get_uclass_priv(dev);
        struct stdio_dev *sdev = &priv->sdev;
-       int ret;
 
        if (!priv->tab_width_frac)
                priv->tab_width_frac = VID_TO_POS(priv->x_charsize) * 8;
@@ -206,11 +205,8 @@ static int vidconsole_post_probe(struct udevice *dev)
        sdev->putc = vidconsole_putc;
        sdev->puts = vidconsole_puts;
        sdev->priv = dev;
-       ret = stdio_register(sdev);
-       if (ret)
-               return ret;
 
-       return 0;
+       return stdio_register(sdev);
 }
 
 UCLASS_DRIVER(vidconsole) = {