Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1569630 > unrolled thread

[PATCH 01/14] crypto: sun4i-ss - simplify optional reset handling

Started byPhilipp Zabel <p.zabel@pengutronix.de>
First post2017-01-30 12:50 +0100
Last post2017-01-30 13:10 +0100
Articles 20 on this page of 24 — 7 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH 01/14] crypto: sun4i-ss - simplify optional reset handling Philipp Zabel <p.zabel@pengutronix.de> - 2017-01-30 12:50 +0100
    [PATCH 09/14] mtd: nand: sunxi: simplify optional reset handling Philipp Zabel <p.zabel@pengutronix.de> - 2017-01-30 12:50 +0100
      Re: [PATCH 09/14] mtd: nand: sunxi: simplify optional reset  handling Boris Brezillon <boris.brezillon@free-electrons.com> - 2017-01-30 14:00 +0100
        Re: [PATCH 09/14] mtd: nand: sunxi: simplify optional reset handling Philipp Zabel <p.zabel@pengutronix.de> - 2017-01-31 18:30 +0100
        Re: [PATCH 09/14] mtd: nand: sunxi: simplify optional reset handling Philipp Zabel <p.zabel@pengutronix.de> - 2017-01-31 19:10 +0100
    [PATCH 03/14] [media] coda: simplify optional reset handling Philipp Zabel <p.zabel@pengutronix.de> - 2017-01-30 12:50 +0100
    [PATCH 05/14] [media] rc: sunxi-cir: simplify optional reset handling Philipp Zabel <p.zabel@pengutronix.de> - 2017-01-30 12:50 +0100
    [PATCH 04/14] [media] st_rc: simplify optional reset handling Philipp Zabel <p.zabel@pengutronix.de> - 2017-01-30 13:10 +0100
      Re: [PATCH 04/14] [media] st_rc: simplify optional reset handling Patrice CHOTARD <patrice.chotard@st.com> - 2017-01-30 13:40 +0100
    [PATCH 13/14] usb: host: ehci-st: simplify optional reset handling Philipp Zabel <p.zabel@pengutronix.de> - 2017-01-30 13:10 +0100
    [PATCH 14/14] ASoC: sunxi: simplify optional reset handling Philipp Zabel <p.zabel@pengutronix.de> - 2017-01-30 13:10 +0100
      Re: [PATCH 14/14] ASoC: sunxi: simplify optional reset handling Mark Brown <broonie@kernel.org> - 2017-01-30 13:40 +0100
        Re: [PATCH 14/14] ASoC: sunxi: simplify optional reset handling Philipp Zabel <p.zabel@pengutronix.de> - 2017-01-30 15:10 +0100
      Re: [PATCH 14/14] ASoC: sunxi: simplify optional reset handling Chen-Yu Tsai <wens@csie.org> - 2017-01-31 05:00 +0100
      Re: [PATCH 14/14] ASoC: sunxi: simplify optional reset handling Mark Brown <broonie@kernel.org> - 2017-01-31 22:30 +0100
    [PATCH 12/14] usb: dwc2: simplify optional reset handling Philipp Zabel <p.zabel@pengutronix.de> - 2017-01-30 13:10 +0100
      Re: [PATCH 12/14] usb: dwc2: simplify optional reset handling John Youn <John.Youn@synopsys.com> - 2017-01-31 01:30 +0100
        Re: [PATCH 12/14] usb: dwc2: simplify optional reset handling John Youn <John.Youn@synopsys.com> - 2017-01-31 01:50 +0100
    [PATCH 08/14] mmc: sunxi: simplify optional reset handling Philipp Zabel <p.zabel@pengutronix.de> - 2017-01-30 13:10 +0100
      Re: [PATCH 08/14] mmc: sunxi: simplify optional reset handling Chen-Yu Tsai <wens@csie.org> - 2017-01-31 05:00 +0100
    [PATCH 06/14] mmc: dw_mmc: simplify optional reset handling Philipp Zabel <p.zabel@pengutronix.de> - 2017-01-30 13:10 +0100
      Re: [PATCH 06/14] mmc: dw_mmc: simplify optional reset handling Ulf Hansson <ulf.hansson@linaro.org> - 2017-01-31 13:00 +0100
        Re: [PATCH 06/14] mmc: dw_mmc: simplify optional reset handling Philipp Zabel <p.zabel@pengutronix.de> - 2017-01-31 18:50 +0100
    [PATCH 10/14] phy: meson8b-usb2: simplify optional reset handling Philipp Zabel <p.zabel@pengutronix.de> - 2017-01-30 13:10 +0100

Page 1 of 2  [1] 2  Next page →


#1569630 — [PATCH 01/14] crypto: sun4i-ss - simplify optional reset handling

FromPhilipp Zabel <p.zabel@pengutronix.de>
Date2017-01-30 12:50 +0100
Subject[PATCH 01/14] crypto: sun4i-ss - simplify optional reset handling
Message-ID<t5iD7-3th-9@gated-at.bofh.it>
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_(de)assert unconditionally.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Cc: Corentin Labbe <clabbe.montjoie@gmail.com>
Cc: Maxime Ripard <maxime.ripard@free-electrons.com>
---
 drivers/crypto/sunxi-ss/sun4i-ss-core.c | 25 +++++++++++--------------
 1 file changed, 11 insertions(+), 14 deletions(-)

diff --git a/drivers/crypto/sunxi-ss/sun4i-ss-core.c b/drivers/crypto/sunxi-ss/sun4i-ss-core.c
index 3ac6c6c4ad18e..e310e311d23ea 100644
--- a/drivers/crypto/sunxi-ss/sun4i-ss-core.c
+++ b/drivers/crypto/sunxi-ss/sun4i-ss-core.c
@@ -258,10 +258,11 @@ static int sun4i_ss_probe(struct platform_device *pdev)
 
 	ss->reset = devm_reset_control_get_optional(&pdev->dev, "ahb");
 	if (IS_ERR(ss->reset)) {
-		if (PTR_ERR(ss->reset) == -EPROBE_DEFER)
-			return PTR_ERR(ss->reset);
-		dev_info(&pdev->dev, "no reset control found\n");
-		ss->reset = NULL;
+		err = PTR_ERR(ss->reset);
+		if (err == -EPROBE_DEFER)
+			return err;
+		dev_err(&pdev->dev, "Cannot get reset control err=%d\n", err);
+		return err;
 	}
 
 	/* Enable both clocks */
@@ -287,12 +288,10 @@ static int sun4i_ss_probe(struct platform_device *pdev)
 	}
 
 	/* Deassert reset if we have a reset control */
-	if (ss->reset) {
-		err = reset_control_deassert(ss->reset);
-		if (err) {
-			dev_err(&pdev->dev, "Cannot deassert reset control\n");
-			goto error_clk;
-		}
+	err = reset_control_deassert(ss->reset);
+	if (err) {
+		dev_err(&pdev->dev, "Cannot deassert reset control\n");
+		goto error_clk;
 	}
 
 	/*
@@ -372,8 +371,7 @@ static int sun4i_ss_probe(struct platform_device *pdev)
 			break;
 		}
 	}
-	if (ss->reset)
-		reset_control_assert(ss->reset);
+	reset_control_assert(ss->reset);
 error_clk:
 	clk_disable_unprepare(ss->ssclk);
 error_ssclk:
@@ -398,8 +396,7 @@ static int sun4i_ss_remove(struct platform_device *pdev)
 	}
 
 	writel(0, ss->base + SS_CTL);
-	if (ss->reset)
-		reset_control_assert(ss->reset);
+	reset_control_assert(ss->reset);
 	clk_disable_unprepare(ss->busclk);
 	clk_disable_unprepare(ss->ssclk);
 	return 0;
-- 
2.11.0

[toc] | [next] | [standalone]


#1569631 — [PATCH 09/14] mtd: nand: sunxi: simplify optional reset handling

FromPhilipp Zabel <p.zabel@pengutronix.de>
Date2017-01-30 12:50 +0100
Subject[PATCH 09/14] mtd: nand: sunxi: simplify optional reset handling
Message-ID<t5iD8-3th-29@gated-at.bofh.it>
In reply to#1569630
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_(de)assert unconditionally.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Cc: Icenowy Zheng <icenowy@aosc.xyz>
Cc: Maxime Ripard <maxime.ripard@free-electrons.com>
Cc: Boris Brezillon <boris.brezillon@free-electrons.com>
---
 drivers/mtd/nand/sunxi_nand.c | 19 ++++++++-----------
 1 file changed, 8 insertions(+), 11 deletions(-)

diff --git a/drivers/mtd/nand/sunxi_nand.c b/drivers/mtd/nand/sunxi_nand.c
index e40482a65de66..c6769b52c666a 100644
--- a/drivers/mtd/nand/sunxi_nand.c
+++ b/drivers/mtd/nand/sunxi_nand.c
@@ -2196,16 +2196,15 @@ static int sunxi_nfc_probe(struct platform_device *pdev)
 		goto out_ahb_clk_unprepare;
 
 	nfc->reset = devm_reset_control_get_optional(dev, "ahb");
-	if (!IS_ERR(nfc->reset)) {
-		ret = reset_control_deassert(nfc->reset);
-		if (ret) {
-			dev_err(dev, "reset err %d\n", ret);
-			goto out_mod_clk_unprepare;
-		}
-	} else if (PTR_ERR(nfc->reset) != -ENOENT) {
+	if (IS_ERR(nfc->reset)) {
 		ret = PTR_ERR(nfc->reset);
 		goto out_mod_clk_unprepare;
 	}
+	ret = reset_control_deassert(nfc->reset);
+	if (ret) {
+		dev_err(dev, "reset err %d\n", ret);
+		goto out_mod_clk_unprepare;
+	}
 
 	ret = sunxi_nfc_rst(nfc);
 	if (ret)
@@ -2246,8 +2245,7 @@ static int sunxi_nfc_probe(struct platform_device *pdev)
 	if (nfc->dmac)
 		dma_release_channel(nfc->dmac);
 out_ahb_reset_reassert:
-	if (!IS_ERR(nfc->reset))
-		reset_control_assert(nfc->reset);
+	reset_control_assert(nfc->reset);
 out_mod_clk_unprepare:
 	clk_disable_unprepare(nfc->mod_clk);
 out_ahb_clk_unprepare:
@@ -2262,8 +2260,7 @@ static int sunxi_nfc_remove(struct platform_device *pdev)
 
 	sunxi_nand_chips_cleanup(nfc);
 
-	if (!IS_ERR(nfc->reset))
-		reset_control_assert(nfc->reset);
+	reset_control_assert(nfc->reset);
 
 	if (nfc->dmac)
 		dma_release_channel(nfc->dmac);
-- 
2.11.0

[toc] | [prev] | [next] | [standalone]


#1569711 — Re: [PATCH 09/14] mtd: nand: sunxi: simplify optional reset handling

FromBoris Brezillon <boris.brezillon@free-electrons.com>
Date2017-01-30 14:00 +0100
SubjectRe: [PATCH 09/14] mtd: nand: sunxi: simplify optional reset handling
Message-ID<t5jIS-45O-27@gated-at.bofh.it>
In reply to#1569631
Hi Philipp,

On Mon, 30 Jan 2017 12:41:11 +0100
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_(de)assert unconditionally.
> 
> Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
> Cc: Icenowy Zheng <icenowy@aosc.xyz>
> Cc: Maxime Ripard <maxime.ripard@free-electrons.com>
> Cc: Boris Brezillon <boris.brezillon@free-electrons.com>

I didn't find commit bb475230b8e5 in mainline, so I guess you plan to
take this patch in your own tree. Let me know if this is not the case.

Acked-by: Boris Brezillon <boris.brezillon@free-electrons.com>

> ---
>  drivers/mtd/nand/sunxi_nand.c | 19 ++++++++-----------
>  1 file changed, 8 insertions(+), 11 deletions(-)
> 
> diff --git a/drivers/mtd/nand/sunxi_nand.c b/drivers/mtd/nand/sunxi_nand.c
> index e40482a65de66..c6769b52c666a 100644
> --- a/drivers/mtd/nand/sunxi_nand.c
> +++ b/drivers/mtd/nand/sunxi_nand.c
> @@ -2196,16 +2196,15 @@ static int sunxi_nfc_probe(struct platform_device *pdev)
>  		goto out_ahb_clk_unprepare;
>  
>  	nfc->reset = devm_reset_control_get_optional(dev, "ahb");
> -	if (!IS_ERR(nfc->reset)) {
> -		ret = reset_control_deassert(nfc->reset);
> -		if (ret) {
> -			dev_err(dev, "reset err %d\n", ret);
> -			goto out_mod_clk_unprepare;
> -		}
> -	} else if (PTR_ERR(nfc->reset) != -ENOENT) {
> +	if (IS_ERR(nfc->reset)) {
>  		ret = PTR_ERR(nfc->reset);
>  		goto out_mod_clk_unprepare;
>  	}
> +	ret = reset_control_deassert(nfc->reset);
> +	if (ret) {
> +		dev_err(dev, "reset err %d\n", ret);
> +		goto out_mod_clk_unprepare;
> +	}
>  
>  	ret = sunxi_nfc_rst(nfc);
>  	if (ret)
> @@ -2246,8 +2245,7 @@ static int sunxi_nfc_probe(struct platform_device *pdev)
>  	if (nfc->dmac)
>  		dma_release_channel(nfc->dmac);
>  out_ahb_reset_reassert:
> -	if (!IS_ERR(nfc->reset))
> -		reset_control_assert(nfc->reset);
> +	reset_control_assert(nfc->reset);
>  out_mod_clk_unprepare:
>  	clk_disable_unprepare(nfc->mod_clk);
>  out_ahb_clk_unprepare:
> @@ -2262,8 +2260,7 @@ static int sunxi_nfc_remove(struct platform_device *pdev)
>  
>  	sunxi_nand_chips_cleanup(nfc);
>  
> -	if (!IS_ERR(nfc->reset))
> -		reset_control_assert(nfc->reset);
> +	reset_control_assert(nfc->reset);
>  
>  	if (nfc->dmac)
>  		dma_release_channel(nfc->dmac);

[toc] | [prev] | [next] | [standalone]


#1570917 — Re: [PATCH 09/14] mtd: nand: sunxi: simplify optional reset handling

FromPhilipp Zabel <p.zabel@pengutronix.de>
Date2017-01-31 18:30 +0100
SubjectRe: [PATCH 09/14] mtd: nand: sunxi: simplify optional reset handling
Message-ID<t5KpI-3sq-13@gated-at.bofh.it>
In reply to#1569711
On Mon, 2017-01-30 at 13:44 +0100, Boris Brezillon wrote:
> Hi Philipp,
> 
> On Mon, 30 Jan 2017 12:41:11 +0100
> 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_(de)assert unconditionally.
> > 
> > Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
> > Cc: Icenowy Zheng <icenowy@aosc.xyz>
> > Cc: Maxime Ripard <maxime.ripard@free-electrons.com>
> > Cc: Boris Brezillon <boris.brezillon@free-electrons.com>
> 
> I didn't find commit bb475230b8e5 in mainline, so I guess you plan to
> take this patch in your own tree. Let me know if this is not the case.
> 
> Acked-by: Boris Brezillon <boris.brezillon@free-electrons.com>

Thanks, I think I'll resend this once bb475230b8e5 hits mainline for you
to merge.

regards
Philipp

[toc] | [prev] | [next] | [standalone]


#1570949 — Re: [PATCH 09/14] mtd: nand: sunxi: simplify optional reset handling

FromPhilipp Zabel <p.zabel@pengutronix.de>
Date2017-01-31 19:10 +0100
SubjectRe: [PATCH 09/14] mtd: nand: sunxi: simplify optional reset handling
Message-ID<t5L2p-3UK-11@gated-at.bofh.it>
In reply to#1569711
On Mon, 2017-01-30 at 13:44 +0100, Boris Brezillon wrote:
> Hi Philipp,
> 
> On Mon, 30 Jan 2017 12:41:11 +0100
> 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_(de)assert unconditionally.
> > 
> > Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
> > Cc: Icenowy Zheng <icenowy@aosc.xyz>
> > Cc: Maxime Ripard <maxime.ripard@free-electrons.com>
> > Cc: Boris Brezillon <boris.brezillon@free-electrons.com>
> 
> I didn't find commit bb475230b8e5 in mainline, so I guess you plan to
> take this patch in your own tree. Let me know if this is not the case.
> 
> Acked-by: Boris Brezillon <boris.brezillon@free-electrons.com>

Thanks, I plan to resend this once bb475230b8e5 hits mainline, for you
to merge.

regards
Philipp

[toc] | [prev] | [next] | [standalone]


#1569632 — [PATCH 03/14] [media] coda: simplify optional reset handling

FromPhilipp Zabel <p.zabel@pengutronix.de>
Date2017-01-30 12:50 +0100
Subject[PATCH 03/14] [media] coda: simplify optional reset handling
Message-ID<t5iD8-3th-21@gated-at.bofh.it>
In reply to#1569630
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>
Cc: Hans Verkuil <hverkuil@xs4all.nl>
Cc: Mauro Carvalho Chehab <mchehab@kernel.org>
---
 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 9e6bdafa16f58..a8482c44b82d2 100644
--- a/drivers/media/platform/coda/coda-common.c
+++ b/drivers/media/platform/coda/coda-common.c
@@ -1840,8 +1840,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.
@@ -2216,13 +2215,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

[toc] | [prev] | [next] | [standalone]


#1569633 — [PATCH 05/14] [media] rc: sunxi-cir: simplify optional reset handling

FromPhilipp Zabel <p.zabel@pengutronix.de>
Date2017-01-30 12:50 +0100
Subject[PATCH 05/14] [media] rc: sunxi-cir: simplify optional reset handling
Message-ID<t5iD8-3th-27@gated-at.bofh.it>
In reply to#1569630
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_(de)assert unconditionally.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
---
 drivers/media/rc/sunxi-cir.c | 21 +++++++--------------
 1 file changed, 7 insertions(+), 14 deletions(-)

diff --git a/drivers/media/rc/sunxi-cir.c b/drivers/media/rc/sunxi-cir.c
index eaadc081760ae..b1e22bd47985e 100644
--- a/drivers/media/rc/sunxi-cir.c
+++ b/drivers/media/rc/sunxi-cir.c
@@ -174,16 +174,11 @@ static int sunxi_ir_probe(struct platform_device *pdev)
 
 	/* Reset (optional) */
 	ir->rst = devm_reset_control_get_optional(dev, NULL);
-	if (IS_ERR(ir->rst)) {
-		ret = PTR_ERR(ir->rst);
-		if (ret == -EPROBE_DEFER)
-			return ret;
-		ir->rst = NULL;
-	} else {
-		ret = reset_control_deassert(ir->rst);
-		if (ret)
-			return ret;
-	}
+	if (IS_ERR(ir->rst))
+		return PTR_ERR(ir->rst);
+	ret = reset_control_deassert(ir->rst);
+	if (ret)
+		return ret;
 
 	ret = clk_set_rate(ir->clk, SUNXI_IR_BASE_CLK);
 	if (ret) {
@@ -292,8 +287,7 @@ static int sunxi_ir_probe(struct platform_device *pdev)
 exit_clkdisable_apb_clk:
 	clk_disable_unprepare(ir->apb_clk);
 exit_reset_assert:
-	if (ir->rst)
-		reset_control_assert(ir->rst);
+	reset_control_assert(ir->rst);
 
 	return ret;
 }
@@ -305,8 +299,7 @@ static int sunxi_ir_remove(struct platform_device *pdev)
 
 	clk_disable_unprepare(ir->clk);
 	clk_disable_unprepare(ir->apb_clk);
-	if (ir->rst)
-		reset_control_assert(ir->rst);
+	reset_control_assert(ir->rst);
 
 	spin_lock_irqsave(&ir->ir_lock, flags);
 	/* disable IR IRQ */
-- 
2.11.0

[toc] | [prev] | [next] | [standalone]


#1569668 — [PATCH 04/14] [media] st_rc: simplify optional reset handling

FromPhilipp Zabel <p.zabel@pengutronix.de>
Date2017-01-30 13:10 +0100
Subject[PATCH 04/14] [media] st_rc: simplify optional reset handling
Message-ID<t5iWt-3Pv-9@gated-at.bofh.it>
In reply to#1569630
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 reset_control_get_optional and to call
reset_control_(de)assert unconditionally.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Cc: Patrice Chotard <patrice.chotard@st.com>
Cc: Mauro Carvalho Chehab <mchehab@kernel.org>
---
 drivers/media/rc/st_rc.c | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/drivers/media/rc/st_rc.c b/drivers/media/rc/st_rc.c
index 1fa0c9d1c5083..04e694b707b45 100644
--- a/drivers/media/rc/st_rc.c
+++ b/drivers/media/rc/st_rc.c
@@ -165,8 +165,7 @@ static void st_rc_hardware_init(struct st_rc_device *dev)
 	unsigned int rx_sampling_freq_div;
 
 	/* Enable the IP */
-	if (dev->rstc)
-		reset_control_deassert(dev->rstc);
+	reset_control_deassert(dev->rstc);
 
 	clk_prepare_enable(dev->sys_clock);
 	baseclock = clk_get_rate(dev->sys_clock);
@@ -281,10 +280,11 @@ static int st_rc_probe(struct platform_device *pdev)
 	else
 		rc_dev->rx_base = rc_dev->base;
 
-
 	rc_dev->rstc = reset_control_get_optional(dev, NULL);
-	if (IS_ERR(rc_dev->rstc))
-		rc_dev->rstc = NULL;
+	if (IS_ERR(rc_dev->rstc)) {
+		ret = PTR_ERR(rc_dev->rstc);
+		goto err;
+	}
 
 	rc_dev->dev = dev;
 	platform_set_drvdata(pdev, rc_dev);
@@ -353,8 +353,7 @@ static int st_rc_suspend(struct device *dev)
 		writel(0x00, rc_dev->rx_base + IRB_RX_EN);
 		writel(0x00, rc_dev->rx_base + IRB_RX_INT_EN);
 		clk_disable_unprepare(rc_dev->sys_clock);
-		if (rc_dev->rstc)
-			reset_control_assert(rc_dev->rstc);
+		reset_control_assert(rc_dev->rstc);
 	}
 
 	return 0;
-- 
2.11.0

[toc] | [prev] | [next] | [standalone]


#1569696 — Re: [PATCH 04/14] [media] st_rc: simplify optional reset handling

FromPatrice CHOTARD <patrice.chotard@st.com>
Date2017-01-30 13:40 +0100
SubjectRe: [PATCH 04/14] [media] st_rc: simplify optional reset handling
Message-ID<t5jpw-3YR-15@gated-at.bofh.it>
In reply to#1569668

On 01/30/2017 12:41 PM, 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.
>
> This allows to return errors from reset_control_get_optional and to call
> reset_control_(de)assert unconditionally.
>
> Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
> Cc: Patrice Chotard <patrice.chotard@st.com>
> Cc: Mauro Carvalho Chehab <mchehab@kernel.org>
> ---
>  drivers/media/rc/st_rc.c | 13 ++++++-------
>  1 file changed, 6 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/media/rc/st_rc.c b/drivers/media/rc/st_rc.c
> index 1fa0c9d1c5083..04e694b707b45 100644
> --- a/drivers/media/rc/st_rc.c
> +++ b/drivers/media/rc/st_rc.c
> @@ -165,8 +165,7 @@ static void st_rc_hardware_init(struct st_rc_device *dev)
>  	unsigned int rx_sampling_freq_div;
>
>  	/* Enable the IP */
> -	if (dev->rstc)
> -		reset_control_deassert(dev->rstc);
> +	reset_control_deassert(dev->rstc);
>
>  	clk_prepare_enable(dev->sys_clock);
>  	baseclock = clk_get_rate(dev->sys_clock);
> @@ -281,10 +280,11 @@ static int st_rc_probe(struct platform_device *pdev)
>  	else
>  		rc_dev->rx_base = rc_dev->base;
>
> -
>  	rc_dev->rstc = reset_control_get_optional(dev, NULL);
> -	if (IS_ERR(rc_dev->rstc))
> -		rc_dev->rstc = NULL;
> +	if (IS_ERR(rc_dev->rstc)) {
> +		ret = PTR_ERR(rc_dev->rstc);
> +		goto err;
> +	}
>
>  	rc_dev->dev = dev;
>  	platform_set_drvdata(pdev, rc_dev);
> @@ -353,8 +353,7 @@ static int st_rc_suspend(struct device *dev)
>  		writel(0x00, rc_dev->rx_base + IRB_RX_EN);
>  		writel(0x00, rc_dev->rx_base + IRB_RX_INT_EN);
>  		clk_disable_unprepare(rc_dev->sys_clock);
> -		if (rc_dev->rstc)
> -			reset_control_assert(rc_dev->rstc);
> +		reset_control_assert(rc_dev->rstc);
>  	}
>
>  	return 0;
>

Hi Philipp

Acked-by: Patrice Chotard <patrice.chotard@st.com>

Thanks

[toc] | [prev] | [next] | [standalone]


#1569672 — [PATCH 13/14] usb: host: ehci-st: simplify optional reset handling

FromPhilipp Zabel <p.zabel@pengutronix.de>
Date2017-01-30 13:10 +0100
Subject[PATCH 13/14] usb: host: ehci-st: simplify optional reset handling
Message-ID<t5iWu-3Pv-23@gated-at.bofh.it>
In reply to#1569630
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_shared
unconditionally.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Cc: Peter Griffin <peter.griffin@linaro.org>
Cc: Lee Jones <lee.jones@linaro.org>
Cc: Alan Stern <stern@rowland.harvard.edu>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/usb/host/ehci-st.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/drivers/usb/host/ehci-st.c b/drivers/usb/host/ehci-st.c
index be4a2788fc582..12e803d2c98df 100644
--- a/drivers/usb/host/ehci-st.c
+++ b/drivers/usb/host/ehci-st.c
@@ -210,18 +210,14 @@ static int st_ehci_platform_probe(struct platform_device *dev)
 		devm_reset_control_get_optional_shared(&dev->dev, "power");
 	if (IS_ERR(priv->pwr)) {
 		err = PTR_ERR(priv->pwr);
-		if (err == -EPROBE_DEFER)
-			goto err_put_clks;
-		priv->pwr = NULL;
+		goto err_put_clks;
 	}
 
 	priv->rst =
 		devm_reset_control_get_optional_shared(&dev->dev, "softreset");
 	if (IS_ERR(priv->rst)) {
 		err = PTR_ERR(priv->rst);
-		if (err == -EPROBE_DEFER)
-			goto err_put_clks;
-		priv->rst = NULL;
+		goto err_put_clks;
 	}
 
 	if (pdata->power_on) {
-- 
2.11.0

[toc] | [prev] | [next] | [standalone]


#1569673 — [PATCH 14/14] ASoC: sunxi: simplify optional reset handling

FromPhilipp Zabel <p.zabel@pengutronix.de>
Date2017-01-30 13:10 +0100
Subject[PATCH 14/14] ASoC: sunxi: simplify optional reset handling
Message-ID<t5iWu-3Pv-33@gated-at.bofh.it>
In reply to#1569630
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(-)

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,
-- 
2.11.0

[toc] | [prev] | [next] | [standalone]


#1569697 — Re: [PATCH 14/14] ASoC: sunxi: simplify optional reset handling

FromMark Brown <broonie@kernel.org>
Date2017-01-30 13:40 +0100
SubjectRe: [PATCH 14/14] ASoC: sunxi: simplify optional reset handling
Message-ID<t5jpw-3YR-33@gated-at.bofh.it>
In reply to#1569673

[Multipart message — attachments visible in raw view] — view raw

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?

[toc] | [prev] | [next] | [standalone]


#1569759 — Re: [PATCH 14/14] ASoC: sunxi: simplify optional reset handling

FromPhilipp Zabel <p.zabel@pengutronix.de>
Date2017-01-30 15:10 +0100
SubjectRe: [PATCH 14/14] ASoC: sunxi: simplify optional reset handling
Message-ID<t5kOB-4Wr-9@gated-at.bofh.it>
In reply to#1569697
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

[toc] | [prev] | [next] | [standalone]


#1570300 — Re: [PATCH 14/14] ASoC: sunxi: simplify optional reset handling

FromChen-Yu Tsai <wens@csie.org>
Date2017-01-31 05:00 +0100
SubjectRe: [PATCH 14/14] ASoC: sunxi: simplify optional reset handling
Message-ID<t5xLP-4aI-7@gated-at.bofh.it>
In reply to#1569673
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>

[toc] | [prev] | [next] | [standalone]


#1571107 — Re: [PATCH 14/14] ASoC: sunxi: simplify optional reset handling

FromMark Brown <broonie@kernel.org>
Date2017-01-31 22:30 +0100
SubjectRe: [PATCH 14/14] ASoC: sunxi: simplify optional reset handling
Message-ID<t5O9X-5HH-1@gated-at.bofh.it>
In reply to#1569673

[Multipart message — attachments visible in raw view] — view raw

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>

[toc] | [prev] | [next] | [standalone]


#1569675 — [PATCH 12/14] usb: dwc2: simplify optional reset handling

FromPhilipp Zabel <p.zabel@pengutronix.de>
Date2017-01-30 13:10 +0100
Subject[PATCH 12/14] usb: dwc2: simplify optional reset handling
Message-ID<t5iWv-3Pv-39@gated-at.bofh.it>
In reply to#1569630
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_(de)assert unconditionally.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Cc: Dinh Nguyen <dinguyen@opensource.altera.com>
Cc: John Youn <johnyoun@synopsys.com>
Cc: Felipe Balbi <felipe.balbi@linux.intel.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/usb/dwc2/platform.c | 18 ++++--------------
 1 file changed, 4 insertions(+), 14 deletions(-)

diff --git a/drivers/usb/dwc2/platform.c b/drivers/usb/dwc2/platform.c
index 4fc8c603afb8b..c6aa2710cecfe 100644
--- a/drivers/usb/dwc2/platform.c
+++ b/drivers/usb/dwc2/platform.c
@@ -214,20 +214,11 @@ static int dwc2_lowlevel_hw_init(struct dwc2_hsotg *hsotg)
 	hsotg->reset = devm_reset_control_get_optional(hsotg->dev, "dwc2");
 	if (IS_ERR(hsotg->reset)) {
 		ret = PTR_ERR(hsotg->reset);
-		switch (ret) {
-		case -ENOENT:
-		case -ENOTSUPP:
-			hsotg->reset = NULL;
-			break;
-		default:
-			dev_err(hsotg->dev, "error getting reset control %d\n",
-				ret);
-			return ret;
-		}
+		dev_err(hsotg->dev, "error getting reset control %d\n", ret);
+		return ret;
 	}
 
-	if (hsotg->reset)
-		reset_control_deassert(hsotg->reset);
+	reset_control_deassert(hsotg->reset);
 
 	/* Set default UTMI width */
 	hsotg->phyif = GUSBCFG_PHYIF16;
@@ -326,8 +317,7 @@ static int dwc2_driver_remove(struct platform_device *dev)
 	if (hsotg->ll_hw_enabled)
 		dwc2_lowlevel_hw_disable(hsotg);
 
-	if (hsotg->reset)
-		reset_control_assert(hsotg->reset);
+	reset_control_assert(hsotg->reset);
 
 	return 0;
 }
-- 
2.11.0

[toc] | [prev] | [next] | [standalone]


#1570207 — Re: [PATCH 12/14] usb: dwc2: simplify optional reset handling

FromJohn Youn <John.Youn@synopsys.com>
Date2017-01-31 01:30 +0100
SubjectRe: [PATCH 12/14] usb: dwc2: simplify optional reset handling
Message-ID<t5uuB-2f0-3@gated-at.bofh.it>
In reply to#1569675
Hi Philipp,

On 1/30/2017 3:42 AM, Philipp Zabel wrote:
> As of commit bb475230b8e5 ("reset: make optional functions really

Where can I find this? It's not in mainline.

John


> 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_(de)assert unconditionally.
>
> Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
> Cc: Dinh Nguyen <dinguyen@opensource.altera.com>
> Cc: John Youn <johnyoun@synopsys.com>
> Cc: Felipe Balbi <felipe.balbi@linux.intel.com>
> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> ---
>  drivers/usb/dwc2/platform.c | 18 ++++--------------
>  1 file changed, 4 insertions(+), 14 deletions(-)
>
> diff --git a/drivers/usb/dwc2/platform.c b/drivers/usb/dwc2/platform.c
> index 4fc8c603afb8b..c6aa2710cecfe 100644
> --- a/drivers/usb/dwc2/platform.c
> +++ b/drivers/usb/dwc2/platform.c
> @@ -214,20 +214,11 @@ static int dwc2_lowlevel_hw_init(struct dwc2_hsotg *hsotg)
>  	hsotg->reset = devm_reset_control_get_optional(hsotg->dev, "dwc2");
>  	if (IS_ERR(hsotg->reset)) {
>  		ret = PTR_ERR(hsotg->reset);
> -		switch (ret) {
> -		case -ENOENT:
> -		case -ENOTSUPP:
> -			hsotg->reset = NULL;
> -			break;
> -		default:
> -			dev_err(hsotg->dev, "error getting reset control %d\n",
> -				ret);
> -			return ret;
> -		}
> +		dev_err(hsotg->dev, "error getting reset control %d\n", ret);
> +		return ret;
>  	}
>
> -	if (hsotg->reset)
> -		reset_control_deassert(hsotg->reset);
> +	reset_control_deassert(hsotg->reset);
>
>  	/* Set default UTMI width */
>  	hsotg->phyif = GUSBCFG_PHYIF16;
> @@ -326,8 +317,7 @@ static int dwc2_driver_remove(struct platform_device *dev)
>  	if (hsotg->ll_hw_enabled)
>  		dwc2_lowlevel_hw_disable(hsotg);
>
> -	if (hsotg->reset)
> -		reset_control_assert(hsotg->reset);
> +	reset_control_assert(hsotg->reset);
>
>  	return 0;
>  }
>

[toc] | [prev] | [next] | [standalone]


#1570210 — Re: [PATCH 12/14] usb: dwc2: simplify optional reset handling

FromJohn Youn <John.Youn@synopsys.com>
Date2017-01-31 01:50 +0100
SubjectRe: [PATCH 12/14] usb: dwc2: simplify optional reset handling
Message-ID<t5uNY-2l4-3@gated-at.bofh.it>
In reply to#1570207
On 1/30/2017 4:28 PM, John Youn wrote:
> Hi Philipp,
>
> On 1/30/2017 3:42 AM, Philipp Zabel wrote:
>> As of commit bb475230b8e5 ("reset: make optional functions really
>
> Where can I find this? It's not in mainline.
>

Never mind. I found on arm-soc per your reply elsewhere.

Acked-by: John Youn <johnyoun@synopsys.com>

Regards,
John


>
>
>> 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_(de)assert unconditionally.
>>
>> Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
>> Cc: Dinh Nguyen <dinguyen@opensource.altera.com>
>> Cc: John Youn <johnyoun@synopsys.com>
>> Cc: Felipe Balbi <felipe.balbi@linux.intel.com>
>> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
>> ---
>>  drivers/usb/dwc2/platform.c | 18 ++++--------------
>>  1 file changed, 4 insertions(+), 14 deletions(-)
>>
>> diff --git a/drivers/usb/dwc2/platform.c b/drivers/usb/dwc2/platform.c
>> index 4fc8c603afb8b..c6aa2710cecfe 100644
>> --- a/drivers/usb/dwc2/platform.c
>> +++ b/drivers/usb/dwc2/platform.c
>> @@ -214,20 +214,11 @@ static int dwc2_lowlevel_hw_init(struct dwc2_hsotg *hsotg)
>>  	hsotg->reset = devm_reset_control_get_optional(hsotg->dev, "dwc2");
>>  	if (IS_ERR(hsotg->reset)) {
>>  		ret = PTR_ERR(hsotg->reset);
>> -		switch (ret) {
>> -		case -ENOENT:
>> -		case -ENOTSUPP:
>> -			hsotg->reset = NULL;
>> -			break;
>> -		default:
>> -			dev_err(hsotg->dev, "error getting reset control %d\n",
>> -				ret);
>> -			return ret;
>> -		}
>> +		dev_err(hsotg->dev, "error getting reset control %d\n", ret);
>> +		return ret;
>>  	}
>>
>> -	if (hsotg->reset)
>> -		reset_control_deassert(hsotg->reset);
>> +	reset_control_deassert(hsotg->reset);
>>
>>  	/* Set default UTMI width */
>>  	hsotg->phyif = GUSBCFG_PHYIF16;
>> @@ -326,8 +317,7 @@ static int dwc2_driver_remove(struct platform_device *dev)
>>  	if (hsotg->ll_hw_enabled)
>>  		dwc2_lowlevel_hw_disable(hsotg);
>>
>> -	if (hsotg->reset)
>> -		reset_control_assert(hsotg->reset);
>> +	reset_control_assert(hsotg->reset);
>>
>>  	return 0;
>>  }
>>
>
>

[toc] | [prev] | [next] | [standalone]


#1569680 — [PATCH 08/14] mmc: sunxi: simplify optional reset handling

FromPhilipp Zabel <p.zabel@pengutronix.de>
Date2017-01-30 13:10 +0100
Subject[PATCH 08/14] mmc: sunxi: simplify optional reset handling
Message-ID<t5iWw-3Pv-67@gated-at.bofh.it>
In reply to#1569630
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_(de)assert unconditionally.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Cc: Maxime Ripard <maxime.ripard@free-electrons.com>
Cc: Chen-Yu Tsai <wens@csie.org>
Cc: Ulf Hansson <ulf.hansson@linaro.org>
---
 drivers/mmc/host/sunxi-mmc.c | 18 +++++++-----------
 1 file changed, 7 insertions(+), 11 deletions(-)

diff --git a/drivers/mmc/host/sunxi-mmc.c b/drivers/mmc/host/sunxi-mmc.c
index b1d1303389a71..cd59a5df6cc86 100644
--- a/drivers/mmc/host/sunxi-mmc.c
+++ b/drivers/mmc/host/sunxi-mmc.c
@@ -1149,7 +1149,7 @@ static int sunxi_mmc_resource_request(struct sunxi_mmc_host *host,
 	}
 
 	host->reset = devm_reset_control_get_optional(&pdev->dev, "ahb");
-	if (PTR_ERR(host->reset) == -EPROBE_DEFER)
+	if (IS_ERR(host->reset))
 		return PTR_ERR(host->reset);
 
 	ret = clk_prepare_enable(host->clk_ahb);
@@ -1176,12 +1176,10 @@ static int sunxi_mmc_resource_request(struct sunxi_mmc_host *host,
 		goto error_disable_clk_output;
 	}
 
-	if (!IS_ERR(host->reset)) {
-		ret = reset_control_deassert(host->reset);
-		if (ret) {
-			dev_err(&pdev->dev, "reset err %d\n", ret);
-			goto error_disable_clk_sample;
-		}
+	ret = reset_control_deassert(host->reset);
+	if (ret) {
+		dev_err(&pdev->dev, "reset err %d\n", ret);
+		goto error_disable_clk_sample;
 	}
 
 	/*
@@ -1197,8 +1195,7 @@ static int sunxi_mmc_resource_request(struct sunxi_mmc_host *host,
 			sunxi_mmc_handle_manual_stop, 0, "sunxi-mmc", host);
 
 error_assert_reset:
-	if (!IS_ERR(host->reset))
-		reset_control_assert(host->reset);
+	reset_control_assert(host->reset);
 error_disable_clk_sample:
 	clk_disable_unprepare(host->clk_sample);
 error_disable_clk_output:
@@ -1281,8 +1278,7 @@ static int sunxi_mmc_remove(struct platform_device *pdev)
 	disable_irq(host->irq);
 	sunxi_mmc_reset_host(host);
 
-	if (!IS_ERR(host->reset))
-		reset_control_assert(host->reset);
+	reset_control_assert(host->reset);
 
 	clk_disable_unprepare(host->clk_sample);
 	clk_disable_unprepare(host->clk_output);
-- 
2.11.0

[toc] | [prev] | [next] | [standalone]


#1570301 — Re: [PATCH 08/14] mmc: sunxi: simplify optional reset handling

FromChen-Yu Tsai <wens@csie.org>
Date2017-01-31 05:00 +0100
SubjectRe: [PATCH 08/14] mmc: sunxi: simplify optional reset handling
Message-ID<t5xLP-4aI-11@gated-at.bofh.it>
In reply to#1569680
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_(de)assert unconditionally.
>
> Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
> Cc: Maxime Ripard <maxime.ripard@free-electrons.com>
> Cc: Chen-Yu Tsai <wens@csie.org>
> Cc: Ulf Hansson <ulf.hansson@linaro.org>

FWIW,

Acked-by: Chen-Yu Tsai <wens@csie.org>

[toc] | [prev] | [next] | [standalone]


Page 1 of 2  [1] 2  Next page →

Back to top | Article view | linux.kernel


csiph-web