Commit 6f2c6afa authored by Ondrej Jirman's avatar Ondrej Jirman Committed by Mauro Carvalho Chehab

media: sunxi: cedrus: Fix missing error message context

When cedrus_hw_probe is called, v4l2_dev is not yet initialized.
Use dev_err instead.
Signed-off-by: default avatarOndrej Jirman <megous@megous.com>
Acked-by: default avatarPaul Kocialkowski <paul.kocialkowski@bootlin.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+samsung@kernel.org>
parent f45f3f75
......@@ -157,14 +157,14 @@ int cedrus_hw_probe(struct cedrus_dev *dev)
irq_dec = platform_get_irq(dev->pdev, 0);
if (irq_dec <= 0) {
v4l2_err(&dev->v4l2_dev, "Failed to get IRQ\n");
dev_err(dev->dev, "Failed to get IRQ\n");
return irq_dec;
}
ret = devm_request_irq(dev->dev, irq_dec, cedrus_irq,
0, dev_name(dev->dev), dev);
if (ret) {
v4l2_err(&dev->v4l2_dev, "Failed to request IRQ\n");
dev_err(dev->dev, "Failed to request IRQ\n");
return ret;
}
......@@ -182,21 +182,21 @@ int cedrus_hw_probe(struct cedrus_dev *dev)
ret = of_reserved_mem_device_init(dev->dev);
if (ret && ret != -ENODEV) {
v4l2_err(&dev->v4l2_dev, "Failed to reserve memory\n");
dev_err(dev->dev, "Failed to reserve memory\n");
return ret;
}
ret = sunxi_sram_claim(dev->dev);
if (ret) {
v4l2_err(&dev->v4l2_dev, "Failed to claim SRAM\n");
dev_err(dev->dev, "Failed to claim SRAM\n");
goto err_mem;
}
dev->ahb_clk = devm_clk_get(dev->dev, "ahb");
if (IS_ERR(dev->ahb_clk)) {
v4l2_err(&dev->v4l2_dev, "Failed to get AHB clock\n");
dev_err(dev->dev, "Failed to get AHB clock\n");
ret = PTR_ERR(dev->ahb_clk);
goto err_sram;
......@@ -204,7 +204,7 @@ int cedrus_hw_probe(struct cedrus_dev *dev)
dev->mod_clk = devm_clk_get(dev->dev, "mod");
if (IS_ERR(dev->mod_clk)) {
v4l2_err(&dev->v4l2_dev, "Failed to get MOD clock\n");
dev_err(dev->dev, "Failed to get MOD clock\n");
ret = PTR_ERR(dev->mod_clk);
goto err_sram;
......@@ -212,7 +212,7 @@ int cedrus_hw_probe(struct cedrus_dev *dev)
dev->ram_clk = devm_clk_get(dev->dev, "ram");
if (IS_ERR(dev->ram_clk)) {
v4l2_err(&dev->v4l2_dev, "Failed to get RAM clock\n");
dev_err(dev->dev, "Failed to get RAM clock\n");
ret = PTR_ERR(dev->ram_clk);
goto err_sram;
......@@ -220,7 +220,7 @@ int cedrus_hw_probe(struct cedrus_dev *dev)
dev->rstc = devm_reset_control_get(dev->dev, NULL);
if (IS_ERR(dev->rstc)) {
v4l2_err(&dev->v4l2_dev, "Failed to get reset control\n");
dev_err(dev->dev, "Failed to get reset control\n");
ret = PTR_ERR(dev->rstc);
goto err_sram;
......@@ -229,7 +229,7 @@ int cedrus_hw_probe(struct cedrus_dev *dev)
res = platform_get_resource(dev->pdev, IORESOURCE_MEM, 0);
dev->base = devm_ioremap_resource(dev->dev, res);
if (IS_ERR(dev->base)) {
v4l2_err(&dev->v4l2_dev, "Failed to map registers\n");
dev_err(dev->dev, "Failed to map registers\n");
ret = PTR_ERR(dev->base);
goto err_sram;
......@@ -237,35 +237,35 @@ int cedrus_hw_probe(struct cedrus_dev *dev)
ret = clk_set_rate(dev->mod_clk, CEDRUS_CLOCK_RATE_DEFAULT);
if (ret) {
v4l2_err(&dev->v4l2_dev, "Failed to set clock rate\n");
dev_err(dev->dev, "Failed to set clock rate\n");
goto err_sram;
}
ret = clk_prepare_enable(dev->ahb_clk);
if (ret) {
v4l2_err(&dev->v4l2_dev, "Failed to enable AHB clock\n");
dev_err(dev->dev, "Failed to enable AHB clock\n");
goto err_sram;
}
ret = clk_prepare_enable(dev->mod_clk);
if (ret) {
v4l2_err(&dev->v4l2_dev, "Failed to enable MOD clock\n");
dev_err(dev->dev, "Failed to enable MOD clock\n");
goto err_ahb_clk;
}
ret = clk_prepare_enable(dev->ram_clk);
if (ret) {
v4l2_err(&dev->v4l2_dev, "Failed to enable RAM clock\n");
dev_err(dev->dev, "Failed to enable RAM clock\n");
goto err_mod_clk;
}
ret = reset_control_reset(dev->rstc);
if (ret) {
v4l2_err(&dev->v4l2_dev, "Failed to apply reset\n");
dev_err(dev->dev, "Failed to apply reset\n");
goto err_ram_clk;
}
......
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