diff options
author | Philipp Zabel <p.zabel@pengutronix.de> | 2017-03-15 14:31:35 +0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@s-opensource.com> | 2017-06-06 14:12:45 +0300 |
commit | 834ebbc8f3a062f18131ff7ad7ddf27dc947e4c2 (patch) | |
tree | a7c0ed2db7445b41f79f7800088e212a859ffe81 /drivers/media/platform | |
parent | 0f42b331b6f7e9281381cc240d8c3a27cf0fa5ca (diff) | |
download | linux-834ebbc8f3a062f18131ff7ad7ddf27dc947e4c2.tar.xz |
[media] coda: simplify optional reset handling
As of commit bb475230b8e5 ("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: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Diffstat (limited to 'drivers/media/platform')
-rw-r--r-- | drivers/media/platform/coda/coda-common.c | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/drivers/media/platform/coda/coda-common.c b/drivers/media/platform/coda/coda-common.c index a6699d872157..0e8e50caa8ff 100644 --- a/drivers/media/platform/coda/coda-common.c +++ b/drivers/media/platform/coda/coda-common.c @@ -2062,8 +2062,7 @@ static int coda_hw_init(struct coda_dev *dev) if (ret) 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. @@ -2447,13 +2446,8 @@ 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); - return ret; - } + dev_err(&pdev->dev, "failed get reset control: %d\n", ret); + return ret; } /* Get IRAM pool from device tree or platform data */ |