Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1601322
| From | Philipp Zabel <p.zabel@pengutronix.de> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH v2 03/14] [media] coda: simplify optional reset handling |
| Date | 2017-03-15 12:40 +0100 |
| Message-ID | <tlfrB-6ZQ-37@gated-at.bofh.it> (permalink) |
| Organization | linux.* mail to news gateway |
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>
---
drivers/media/platform/coda/coda-common.c | 12 +++---------
1 file changed, 3 insertions(+), 9 deletions(-)
diff --git a/drivers/media/platform/coda/coda-common.c b/drivers/media/platform/coda/coda-common.c
index eb6548f46cbac..0cf667ab44bfb 100644
--- a/drivers/media/platform/coda/coda-common.c
+++ b/drivers/media/platform/coda/coda-common.c
@@ -1982,8 +1982,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.
@@ -2362,13 +2361,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 */
--
2.11.0
Back to linux.kernel | Previous | Next — Next in thread | Find similar | Unroll thread
[PATCH v2 03/14] [media] coda: simplify optional reset handling Philipp Zabel <p.zabel@pengutronix.de> - 2017-03-15 12:40 +0100
Re: [PATCH v2 03/14] [media] coda: simplify optional reset handling Hans Verkuil <hverkuil@xs4all.nl> - 2017-03-20 11:30 +0100
Re: [PATCH v2 03/14] [media] coda: simplify optional reset handling Philipp Zabel <p.zabel@pengutronix.de> - 2017-03-20 11:40 +0100
csiph-web