Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 834ebbc8 authored by Philipp Zabel's avatar Philipp Zabel Committed by Mauro Carvalho Chehab
Browse files

[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: default avatarPhilipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
parent 0f42b331
Loading
Loading
Loading
Loading
+3 −9
Original line number Diff line number Diff line
@@ -2062,7 +2062,6 @@ static int coda_hw_init(struct coda_dev *dev)
	if (ret)
		goto err_clk_ahb;

	if (dev->rstc)
	reset_control_reset(dev->rstc);

	/*
@@ -2447,14 +2446,9 @@ static int coda_probe(struct platform_device *pdev)
	dev->rstc = devm_reset_control_get_optional(&pdev->dev, NULL);
	if (IS_ERR(dev->rstc)) {
		ret = PTR_ERR(dev->rstc);
		if (ret == -ENOENT || ret == -ENOTSUPP) {
			dev->rstc = NULL;
		} else {
			dev_err(&pdev->dev, "failed get reset control: %d\n",
				ret);
		dev_err(&pdev->dev, "failed get reset control: %d\n", ret);
		return ret;
	}
	}

	/* Get IRAM pool from device tree or platform data */
	pool = of_gen_pool_get(np, "iram", 0);