Re: [RESEND v2 02/11] usb:hsotg:samsung: Wrappers for USB PHY methods

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

 



On Wed, Mar 21, 2012 at 12:59:40PM +0100, Lukasz Majewski wrote:
> Wrappers for PHY methods have been added for readability and reduction
> of code repetition.
> 
> Signed-off-by: Lukasz Majewski <l.majewski@xxxxxxxxxxx>
> Signed-off-by: Kyungmin Park <kyungmin.park@xxxxxxxxxxx>
> ---
>  drivers/usb/gadget/s3c-hsotg.c |   47 ++++++++++++++++++++++++++++++++++------
>  1 files changed, 40 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/usb/gadget/s3c-hsotg.c b/drivers/usb/gadget/s3c-hsotg.c
> index 6dab16a..4170654 100644
> --- a/drivers/usb/gadget/s3c-hsotg.c
> +++ b/drivers/usb/gadget/s3c-hsotg.c
> @@ -2570,6 +2570,41 @@ static int s3c_hsotg_corereset(struct s3c_hsotg *hsotg)
>  	return 0;
>  }
>  
> +/**
> + * s3c_hsotg_phy_enable - enable platform phy dev
> + *
> + * @param: The driver state
> + *
> + * A wrapper for platform code responsible for controlling
> + * low-level USB code
> + */
> +static void s3c_hsotg_phy_enable(struct s3c_hsotg *hsotg)
> +{
> +	struct platform_device *pdev =
> +		container_of(hsotg->dev, struct platform_device, dev);

to_platform_device(hsotg->dev) ???

> +	printk(KERN_ERR "%s: pdev 0x%p\n", __func__, pdev);

dev_dbg() or dev_vdbg() seems more fitting.

> +	if (hsotg->plat->phy_init)
> +		hsotg->plat->phy_init(pdev, S5P_USB_PHY_DEVICE);
> +}
> +
> +/**
> + * s3c_hsotg_phy_disable - disable platform phy dev
> + *
> + * @param: The driver state
> + *
> + * A wrapper for platform code responsible for controlling
> + * low-level USB code
> + */
> +static void s3c_hsotg_phy_disable(struct s3c_hsotg *hsotg)
> +{
> +	struct platform_device *pdev =
> +		container_of(hsotg->dev, struct platform_device, dev);
> +
> +	if (hsotg->plat->phy_exit)
> +		hsotg->plat->phy_exit(pdev, S5P_USB_PHY_DEVICE);
> +}
> +
>  static int s3c_hsotg_start(struct usb_gadget_driver *driver,
>  		int (*bind)(struct usb_gadget *))
>  {
> @@ -3317,8 +3352,9 @@ static int __devinit s3c_hsotg_probe(struct platform_device *pdev)
>  
>  	clk_enable(hsotg->clk);
>  
> -	if (plat->phy_init)
> -		plat->phy_init(pdev, S5P_USB_PHY_DEVICE);
> +	/* usb phy enable */
> +

remove this trailing blank line

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