Re: [PATCH 1/2] usb: musb: kill global and static for multi instance

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

 



On Mon, Jun 25, 2012 at 05:51:46PM +0530, Ajay Kumar Gupta wrote:
> Moved global variable "orig_dma_mask" and static variables "first"
> and "old_state" to 'struct musb' to help support multi instance of
> musb controller as present on AM335x platform.
> 
> Signed-off-by: Ajay Kumar Gupta <ajay.gupta@xxxxxx>
> ---
>  drivers/usb/musb/musb_core.c |   28 ++++++++++++----------------
>  drivers/usb/musb/musb_core.h |    5 +++++
>  2 files changed, 17 insertions(+), 16 deletions(-)
> 
> diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c
> index db3dff8..e89b232 100644
> --- a/drivers/usb/musb/musb_core.c
> +++ b/drivers/usb/musb/musb_core.c
> @@ -1785,10 +1785,9 @@ static const struct attribute_group musb_attr_group = {
>  static void musb_irq_work(struct work_struct *data)
>  {
>  	struct musb *musb = container_of(data, struct musb, irq_work);
> -	static int old_state;
>  
> -	if (musb->xceiv->state != old_state) {
> -		old_state = musb->xceiv->state;
> +	if (musb->xceiv->state != musb->xceiv_old_state) {
> +		musb->xceiv_old_state = musb->xceiv->state;
>  		sysfs_notify(&musb->controller->kobj, NULL, "mode");
>  	}
>  }
> @@ -1906,6 +1905,12 @@ musb_init_controller(struct device *dev, int nIrq, void __iomem *ctrl)
>  	musb->min_power = plat->min_power;
>  	musb->ops = plat->platform_ops;
>  
> +	musb->first = 1;

this needs to go away and it should be very simple to do so. The problem
which Hema was trying to fix is just a misplaced platform_set_drvdata()
in relation to pm_runtime_enable().

> +#ifndef CONFIG_MUSB_PIO_ONLY
> +	musb->orig_dma_mask = dev->dma_mask;
> +#endif

this I can't accept, you can just point to the parent device's
dma_mask.

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