mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2025-01-08 14:54:23 +08:00
power: reset: at91-reset: check properly the return value of devm_of_iomap
[ Upstream commitf558c8072c
] devm_of_iomap() returns error code or valid pointer. Check its return value with IS_ERR(). Fixes:bd3127733f
("power: reset: at91-reset: use devm_of_iomap") Reported-by: Cristian Birsan <cristian.birsan@microchip.com> Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
9a8d7bdd5b
commit
a1e06f92b2
@ -193,7 +193,7 @@ static int __init at91_reset_probe(struct platform_device *pdev)
|
||||
return -ENOMEM;
|
||||
|
||||
reset->rstc_base = devm_of_iomap(&pdev->dev, pdev->dev.of_node, 0, NULL);
|
||||
if (!reset->rstc_base) {
|
||||
if (IS_ERR(reset->rstc_base)) {
|
||||
dev_err(&pdev->dev, "Could not map reset controller address\n");
|
||||
return -ENODEV;
|
||||
}
|
||||
@ -203,7 +203,7 @@ static int __init at91_reset_probe(struct platform_device *pdev)
|
||||
for_each_matching_node_and_match(np, at91_ramc_of_match, &match) {
|
||||
reset->ramc_lpr = (u32)match->data;
|
||||
reset->ramc_base[idx] = devm_of_iomap(&pdev->dev, np, 0, NULL);
|
||||
if (!reset->ramc_base[idx]) {
|
||||
if (IS_ERR(reset->ramc_base[idx])) {
|
||||
dev_err(&pdev->dev, "Could not map ram controller address\n");
|
||||
of_node_put(np);
|
||||
return -ENODEV;
|
||||
|
Loading…
Reference in New Issue
Block a user