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


Groups > linux.kernel > #1570207

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

From John Youn <John.Youn@synopsys.com>
Newsgroups linux.kernel
Subject Re: [PATCH 12/14] usb: dwc2: simplify optional reset handling
Date 2017-01-31 01:30 +0100
Message-ID <t5uuB-2f0-3@gated-at.bofh.it> (permalink)
References <t5iD7-3th-9@gated-at.bofh.it> <t5iWv-3Pv-39@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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;
>  }
>

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[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

csiph-web