diff mbox

[14/14] ASoC: sunxi: simplify optional reset handling

Message ID 20170130114116.22089-14-p.zabel@pengutronix.de (mailing list archive)
State New, archived
Headers show

Commit Message

Philipp Zabel Jan. 30, 2017, 11:41 a.m. UTC
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 and to
call reset_control_deassert unconditionally.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Cc: Marcus Cooper <codekipper@gmail.com>
Cc: Maxime Ripard <maxime.ripard@free-electrons.com>
Cc: Chen-Yu Tsai <wens@csie.org>
Cc: Mark Brown <broonie@kernel.org>
---
 sound/soc/sunxi/sun4i-spdif.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

Comments

Mark Brown Jan. 30, 2017, 12:30 p.m. UTC | #1
On Mon, Jan 30, 2017 at 12:41:16PM +0100, Philipp Zabel wrote:
> 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.

I've only got this patch from the series, what's the story with
dependencies and so on?
Philipp Zabel Jan. 30, 2017, 1:45 p.m. UTC | #2
On Mon, 2017-01-30 at 12:30 +0000, Mark Brown wrote:
> On Mon, Jan 30, 2017 at 12:41:16PM +0100, Philipp Zabel wrote:
> > 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.
> 
> I've only got this patch from the series, what's the story with
> dependencies and so on?

This is a cleanup series across subsystems. The referenced commit is the
only dependency, it only just got merged into the arm-soc tree. There
are no dependencies between patches of this series.

I could merge this through the reset tree with your acks or resend it
individually once the above commit hits mainline, whichever you prefer.

regards
Philipp
Chen-Yu Tsai Jan. 31, 2017, 3:49 a.m. UTC | #3
On Mon, Jan 30, 2017 at 7:41 PM, Philipp Zabel <p.zabel@pengutronix.de> wrote:
> 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 and to
> call reset_control_deassert unconditionally.
>
> Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
> Cc: Marcus Cooper <codekipper@gmail.com>
> Cc: Maxime Ripard <maxime.ripard@free-electrons.com>
> Cc: Chen-Yu Tsai <wens@csie.org>
> Cc: Mark Brown <broonie@kernel.org>

FWIW,

Acked-by: Chen-Yu Tsai <wens@csie.org>
Mark Brown Jan. 31, 2017, 9 p.m. UTC | #4
On Mon, Jan 30, 2017 at 12:41:16PM +0100, Philipp Zabel wrote:
> 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.

Acked-by: Mark Brown <broonie@kernel.org>
diff mbox

Patch

diff --git a/sound/soc/sunxi/sun4i-spdif.c b/sound/soc/sunxi/sun4i-spdif.c
index 88fbb3a1e6601..d02d91b168243 100644
--- a/sound/soc/sunxi/sun4i-spdif.c
+++ b/sound/soc/sunxi/sun4i-spdif.c
@@ -493,13 +493,12 @@  static int sun4i_spdif_probe(struct platform_device *pdev)
 	if (of_device_is_compatible(pdev->dev.of_node,
 				    "allwinner,sun6i-a31-spdif")) {
 		host->rst = devm_reset_control_get_optional(&pdev->dev, NULL);
-		if (IS_ERR(host->rst) && PTR_ERR(host->rst) == -EPROBE_DEFER) {
-			ret = -EPROBE_DEFER;
+		if (IS_ERR(host->rst)) {
+			ret = PTR_ERR(host->rst);
 			dev_err(&pdev->dev, "Failed to get reset: %d\n", ret);
 			goto err_disable_apb_clk;
 		}
-		if (!IS_ERR(host->rst))
-			reset_control_deassert(host->rst);
+		reset_control_deassert(host->rst);
 	}
 
 	ret = devm_snd_soc_register_component(&pdev->dev,