Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/sti: correctly test devm_ioremap() return

In case of error, the function devm_ioremap_nocache() returns NULL
not ERR_PTR(). The IS_ERR() test in the return value check should
be replaced with NULL test.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>

authored by

Wei Yongjun and committed by
Benjamin Gaignard
d3c8a0b2 ae455773

+2 -2
+2 -2
drivers/gpu/drm/sti/sti_dvo.c
··· 499 499 } 500 500 dvo->regs = devm_ioremap_nocache(dev, res->start, 501 501 resource_size(res)); 502 - if (IS_ERR(dvo->regs)) 503 - return PTR_ERR(dvo->regs); 502 + if (!dvo->regs) 503 + return -ENOMEM; 504 504 505 505 dvo->clk_pix = devm_clk_get(dev, "dvo_pix"); 506 506 if (IS_ERR(dvo->clk_pix)) {