Re: [PATCH 2/3 v2] usb: renesas_usbhs: support multi-channels

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

 



Hi Morimoto-san,

On Thu, Jun 16, 2011 at 2:25 PM, Kuninori Morimoto
<kuninori.morimoto.gx@xxxxxxxxxxx> wrote:
> current renesas_usbhs was caring only 1 "the_controller".
> But, in generally, it has 2 channels.
>
> This patch support multi-channels
>
> Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@xxxxxxxxxxx>
> ---
>  drivers/usb/renesas_usbhs/mod_gadget.c |   47 +++++++++++++++++++++++++++----
>  1 files changed, 41 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/usb/renesas_usbhs/mod_gadget.c b/drivers/usb/renesas_usbhs/mod_gadget.c
> index aa591b6..f650296 100644
> --- a/drivers/usb/renesas_usbhs/mod_gadget.c
> +++ b/drivers/usb/renesas_usbhs/mod_gadget.c
> @@ -724,13 +724,15 @@ static int usbhsg_try_stop(struct usbhs_priv *priv, u32 status)
>  *             linux usb function
>  *
>  */
> -struct usbhsg_gpriv *the_controller;
> +#define THE_CONTROLLER_CNT 2 /* USB0 and USB1 */
> +struct usbhsg_gpriv *the_controllers[THE_CONTROLLER_CNT];

Sorry, but this is just too ugly to be acceptable. I would prefer not
to have these kind of global variables at all if possible, but I
realize that's not up to you. I don't have any good suggestion to fix
this on a global scale either, so I should probably just shut up.

Anyway, since we do seem to need global state, why don't you fix up
the code to use a linked list implementation instead?

Thanks,

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


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

  Powered by Linux