Re: [PATCHv3 2/2] usb: dwc2: Add reset control to dwc2

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On Thursday 14 April 2016, dinguyen@xxxxxxxxxxxxxxxxxxxxx wrote:
> @@ -337,6 +338,17 @@ static int dwc2_lowlevel_hw_init(struct dwc2_hsotg *hsotg)
>  {
>         int i, ret;
>  
> +       hsotg->reset = devm_reset_control_get(hsotg->dev, "dwc2");
> +       if (IS_ERR(hsotg->reset)) {
> +               if (PTR_ERR(hsotg->reset) == -EPROBE_DEFER)
> +                       return -EPROBE_DEFER;
> +               dev_dbg(hsotg->dev, "Could not get reset control.\n");
> +               hsotg->reset = NULL;
> +       }
> +
> +       if(hsotg->reset)
> +               reset_control_deassert(hsotg->reset);


The error handling seems a bit odd here. If there is a failure to get the
reset control and it's actually needed, I would argue the init function should
not continue. Conversely, if there was no reset line specified in the
device, why even print a message about it?

	Arnd
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]
  Powered by Linux