提交 834ebbc8 编写于 作者: P Philipp Zabel 提交者: Mauro Carvalho Chehab

[media] coda: simplify optional reset handling

As of commit bb475230 ("reset: make optional functions really
optional"), the reset framework API calls use NULL pointers to
describe optional, non-present reset controls.

This allows to return errors from devm_reset_control_get_optional
without special cases and to call reset_control_reset unconditionally.
Signed-off-by: NPhilipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: NHans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: NMauro Carvalho Chehab <mchehab@s-opensource.com>
上级 0f42b331
...@@ -2062,8 +2062,7 @@ static int coda_hw_init(struct coda_dev *dev) ...@@ -2062,8 +2062,7 @@ static int coda_hw_init(struct coda_dev *dev)
if (ret) if (ret)
goto err_clk_ahb; goto err_clk_ahb;
if (dev->rstc) reset_control_reset(dev->rstc);
reset_control_reset(dev->rstc);
/* /*
* Copy the first CODA_ISRAM_SIZE in the internal SRAM. * Copy the first CODA_ISRAM_SIZE in the internal SRAM.
...@@ -2447,13 +2446,8 @@ static int coda_probe(struct platform_device *pdev) ...@@ -2447,13 +2446,8 @@ static int coda_probe(struct platform_device *pdev)
dev->rstc = devm_reset_control_get_optional(&pdev->dev, NULL); dev->rstc = devm_reset_control_get_optional(&pdev->dev, NULL);
if (IS_ERR(dev->rstc)) { if (IS_ERR(dev->rstc)) {
ret = PTR_ERR(dev->rstc); ret = PTR_ERR(dev->rstc);
if (ret == -ENOENT || ret == -ENOTSUPP) { dev_err(&pdev->dev, "failed get reset control: %d\n", ret);
dev->rstc = NULL; return ret;
} else {
dev_err(&pdev->dev, "failed get reset control: %d\n",
ret);
return ret;
}
} }
/* Get IRAM pool from device tree or platform data */ /* Get IRAM pool from device tree or platform data */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册