[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Tue, 7 Jul 2020 06:33:22 +0000
From: Peter Chen <peter.chen@....com>
To: Pawel Laszczak <pawell@...ence.com>
CC: "balbi@...nel.org" <balbi@...nel.org>,
"gregkh@...uxfoundation.org" <gregkh@...uxfoundation.org>,
"linux-usb@...r.kernel.org" <linux-usb@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"rogerq@...com" <rogerq@...com>,
"dan.carpenter@...cle.com" <dan.carpenter@...cle.com>,
"heikki.krogerus@...ux.intel.com" <heikki.krogerus@...ux.intel.com>,
"colin.king@...onical.com" <colin.king@...onical.com>,
"jpawar@...ence.com" <jpawar@...ence.com>,
"ben.dooks@...ethink.co.uk" <ben.dooks@...ethink.co.uk>,
"kurahul@...ence.com" <kurahul@...ence.com>,
"sparmar@...ence.com" <sparmar@...ence.com>
Subject: Re: [PATCH 7/9] usb: cdns3: Improvement: removed 'goto not_otg'
On 20-07-01 08:20:02, Pawel Laszczak wrote:
> Patch removes 'goto not_otg' instruction from
> cdnsp_hw_role_state_machine function.
Should be cdns3_hw_role_state_machine.
Peter
>
> Signed-off-by: Pawel Laszczak <pawell@...ence.com>
> ---
> drivers/usb/cdns3/core.c | 20 +++++++++-----------
> 1 file changed, 9 insertions(+), 11 deletions(-)
>
> diff --git a/drivers/usb/cdns3/core.c b/drivers/usb/cdns3/core.c
> index c3dac945f63d..591186987245 100644
> --- a/drivers/usb/cdns3/core.c
> +++ b/drivers/usb/cdns3/core.c
> @@ -191,11 +191,17 @@ static int cdns3_core_init_role(struct cdns3 *cdns)
> */
> static enum usb_role cdns3_hw_role_state_machine(struct cdns3 *cdns)
> {
> - enum usb_role role;
> + enum usb_role role = USB_ROLE_NONE;
> int id, vbus;
>
> - if (cdns->dr_mode != USB_DR_MODE_OTG)
> - goto not_otg;
> + if (cdns->dr_mode != USB_DR_MODE_OTG) {
> + if (cdns3_is_host(cdns))
> + role = USB_ROLE_HOST;
> + if (cdns3_is_device(cdns))
> + role = USB_ROLE_DEVICE;
> +
> + return role;
> + }
>
> id = cdns3_get_id(cdns);
> vbus = cdns3_get_vbus(cdns);
> @@ -232,14 +238,6 @@ static enum usb_role cdns3_hw_role_state_machine(struct cdns3 *cdns)
> dev_dbg(cdns->dev, "role %d -> %d\n", cdns->role, role);
>
> return role;
> -
> -not_otg:
> - if (cdns3_is_host(cdns))
> - role = USB_ROLE_HOST;
> - if (cdns3_is_device(cdns))
> - role = USB_ROLE_DEVICE;
> -
> - return role;
> }
>
> static int cdns3_idle_role_start(struct cdns3 *cdns)
> --
> 2.17.1
>
--
Thanks,
Peter Chen
Powered by blists - more mailing lists