Re: [PATCH v11 8/9] usb: chipidea: imx: add getting vbus regulator code

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

 



Hi,

On Wed, Mar 06, 2013 at 05:56:39PM +0800, Peter Chen wrote:
> Signed-off-by: Peter Chen <peter.chen@xxxxxxxxxxxxx>
> ---
>  drivers/usb/chipidea/ci13xxx_imx.c |   28 +++++-----------------------
>  1 files changed, 5 insertions(+), 23 deletions(-)
> 
> diff --git a/drivers/usb/chipidea/ci13xxx_imx.c b/drivers/usb/chipidea/ci13xxx_imx.c
> index 3ed119e..b2d8350 100644
> --- a/drivers/usb/chipidea/ci13xxx_imx.c
> +++ b/drivers/usb/chipidea/ci13xxx_imx.c
> @@ -33,7 +33,6 @@ struct ci13xxx_imx_data {
>  	struct usb_phy *phy;
>  	struct platform_device *ci_pdev;
>  	struct clk *clk;
> -	struct regulator *reg_vbus;
>  };
>  
>  static const struct usbmisc_ops *usbmisc_ops;
> @@ -163,20 +162,9 @@ static int ci13xxx_imx_probe(struct platform_device *pdev)
>  		data->phy = phy;
>  	}
>  
> -	/* we only support host now, so enable vbus here */
>  	reg_vbus = devm_regulator_get(&pdev->dev, "vbus");
> -	if (!IS_ERR(reg_vbus)) {
> -		ret = regulator_enable(reg_vbus);
> -		if (ret) {
> -			dev_err(&pdev->dev,
> -				"Failed to enable vbus regulator, err=%d\n",
> -				ret);
> -			goto err_clk;
> -		}
> -		data->reg_vbus = reg_vbus;
> -	} else {
> -		reg_vbus = NULL;
> -	}
> +	if (!IS_ERR(reg_vbus))
> +		pdata->reg_vbus = reg_vbus;

what you're doing here is wrong. chipidea core should be the one calling
devm_regulator_get().

-- 
balbi

Attachment: signature.asc
Description: Digital signature


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux