提交 6c131850 编写于 作者: J Julia Lawall 提交者: Tomi Valkeinen

drivers: video: fbdev: atmel_lcdfb.c: fix error return code

Convert a zero return value on error to a negative one, as returned
elsewhere in the function.

A simplified version of the semantic match that finds this problem is as
follows: (http://coccinelle.lip6.fr/)

// <smpl>
(
if@p1 (\(ret < 0\|ret != 0\))
 { ... return ret; }
|
ret@p1 = 0
)
... when != ret = e1
    when != &ret
*if(...)
{
  ... when != ret = e2
      when forall
 return ret;
}

// </smpl>
Signed-off-by: NJulia Lawall <Julia.Lawall@lip6.fr>
Acked-by: NNicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: NTomi Valkeinen <tomi.valkeinen@ti.com>
上级 2b6c53b1
...@@ -1102,12 +1102,14 @@ static int atmel_lcdfb_of_init(struct atmel_lcdfb_info *sinfo) ...@@ -1102,12 +1102,14 @@ static int atmel_lcdfb_of_init(struct atmel_lcdfb_info *sinfo)
timings = of_get_display_timings(display_np); timings = of_get_display_timings(display_np);
if (!timings) { if (!timings) {
dev_err(dev, "failed to get display timings\n"); dev_err(dev, "failed to get display timings\n");
ret = -EINVAL;
goto put_display_node; goto put_display_node;
} }
timings_np = of_find_node_by_name(display_np, "display-timings"); timings_np = of_find_node_by_name(display_np, "display-timings");
if (!timings_np) { if (!timings_np) {
dev_err(dev, "failed to find display-timings node\n"); dev_err(dev, "failed to find display-timings node\n");
ret = -ENODEV;
goto put_display_node; goto put_display_node;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册