Commit d93d45ab authored by Dan Carpenter's avatar Dan Carpenter Committed by Mauro Carvalho Chehab

media: allegro: Fix some NULL vs IS_ERR() checks in probe

The devm_ioremap() function doesn't return error pointers, it returns
NULL on error.

Fixes: f20387df ("media: allegro: add Allegro DVT video IP core driver")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
parent b820935b
......@@ -3065,9 +3065,9 @@ static int allegro_probe(struct platform_device *pdev)
return -EINVAL;
}
regs = devm_ioremap(&pdev->dev, res->start, resource_size(res));
if (IS_ERR(regs)) {
if (!regs) {
dev_err(&pdev->dev, "failed to map registers\n");
return PTR_ERR(regs);
return -ENOMEM;
}
dev->regmap = devm_regmap_init_mmio(&pdev->dev, regs,
&allegro_regmap_config);
......@@ -3085,9 +3085,9 @@ static int allegro_probe(struct platform_device *pdev)
sram_regs = devm_ioremap(&pdev->dev,
sram_res->start,
resource_size(sram_res));
if (IS_ERR(sram_regs)) {
if (!sram_regs) {
dev_err(&pdev->dev, "failed to map sram\n");
return PTR_ERR(sram_regs);
return -ENOMEM;
}
dev->sram = devm_regmap_init_mmio(&pdev->dev, sram_regs,
&allegro_sram_config);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment