mirror of https://gitee.com/openkylin/linux.git
[ARM] arch/arm/common/sa1111.c: Correct error handling code
If it is reasonable to apply PTR_ERR to the result of calling clk_get, then that result should first be tested with IS_ERR, not with !. The semantic patch that makes this change is as follows: (http://www.emn.fr/x-info/coccinelle/) // <smpl> @@ expression E,E1; @@ if ( - E == NULL + IS_ERR(E) ) { <+... when != E = E1 PTR_ERR(E) ...+> } // </smpl> Signed-off-by: Julia Lawall <julia@diku.dk> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
This commit is contained in:
parent
674a0a6939
commit
442a902262
|
@ -630,7 +630,7 @@ __sa1111_probe(struct device *me, struct resource *mem, int irq)
|
|||
return -ENOMEM;
|
||||
|
||||
sachip->clk = clk_get(me, "SA1111_CLK");
|
||||
if (!sachip->clk) {
|
||||
if (IS_ERR(sachip->clk)) {
|
||||
ret = PTR_ERR(sachip->clk);
|
||||
goto err_free;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue