提交 7aac8d15 编写于 作者: K Kuninori Morimoto 提交者: Felipe Balbi

usb: gadget: renesas_usbhs: parameter cleanup for usbhsh_device_xx()

current mod_host used usbhs_device_alloc/free(),
but allocated variable was attached to each xx->hcpriv.
The intuitively clear name was not xxx_alloc/free() but xxx_attach/detach().
Signed-off-by: NKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: NFelipe Balbi <balbi@ti.com>
上级 4825093e
...@@ -220,7 +220,7 @@ static int usbhsh_device_has_endpoint(struct usbhsh_device *udev) ...@@ -220,7 +220,7 @@ static int usbhsh_device_has_endpoint(struct usbhsh_device *udev)
return !list_empty(&udev->ep_list_head); return !list_empty(&udev->ep_list_head);
} }
static struct usbhsh_device *usbhsh_device_alloc(struct usbhsh_hpriv *hpriv, static struct usbhsh_device *usbhsh_device_attach(struct usbhsh_hpriv *hpriv,
struct urb *urb) struct urb *urb)
{ {
struct usbhsh_device *udev = NULL; struct usbhsh_device *udev = NULL;
...@@ -307,7 +307,7 @@ static struct usbhsh_device *usbhsh_device_alloc(struct usbhsh_hpriv *hpriv, ...@@ -307,7 +307,7 @@ static struct usbhsh_device *usbhsh_device_alloc(struct usbhsh_hpriv *hpriv,
return udev; return udev;
} }
static void usbhsh_device_free(struct usbhsh_hpriv *hpriv, static void usbhsh_device_detach(struct usbhsh_hpriv *hpriv,
struct usbhsh_device *udev) struct usbhsh_device *udev)
{ {
struct usb_hcd *hcd = usbhsh_hpriv_to_hcd(hpriv); struct usb_hcd *hcd = usbhsh_hpriv_to_hcd(hpriv);
...@@ -744,7 +744,7 @@ static int usbhsh_urb_enqueue(struct usb_hcd *hcd, ...@@ -744,7 +744,7 @@ static int usbhsh_urb_enqueue(struct usb_hcd *hcd,
struct device *dev = usbhs_priv_to_dev(priv); struct device *dev = usbhs_priv_to_dev(priv);
struct usb_device *usbv = usbhsh_urb_to_usbv(urb); struct usb_device *usbv = usbhsh_urb_to_usbv(urb);
struct usb_host_endpoint *ep = urb->ep; struct usb_host_endpoint *ep = urb->ep;
struct usbhsh_device *udev, *new_udev = NULL; struct usbhsh_device *new_udev = NULL;
int is_dir_in = usb_pipein(urb->pipe); int is_dir_in = usb_pipein(urb->pipe);
int ret; int ret;
...@@ -756,15 +756,12 @@ static int usbhsh_urb_enqueue(struct usb_hcd *hcd, ...@@ -756,15 +756,12 @@ static int usbhsh_urb_enqueue(struct usb_hcd *hcd,
goto usbhsh_urb_enqueue_error_not_linked; goto usbhsh_urb_enqueue_error_not_linked;
/* /*
* get udev * attach udev if needed
*/ */
udev = usbhsh_usbv_to_udev(usbv); if (!usbhsh_usbv_to_udev(usbv)) {
if (!udev) { new_udev = usbhsh_device_attach(hpriv, urb);
new_udev = usbhsh_device_alloc(hpriv, urb);
if (!new_udev) if (!new_udev)
goto usbhsh_urb_enqueue_error_not_linked; goto usbhsh_urb_enqueue_error_not_linked;
udev = new_udev;
} }
/* /*
...@@ -788,7 +785,7 @@ static int usbhsh_urb_enqueue(struct usb_hcd *hcd, ...@@ -788,7 +785,7 @@ static int usbhsh_urb_enqueue(struct usb_hcd *hcd,
usbhsh_urb_enqueue_error_free_device: usbhsh_urb_enqueue_error_free_device:
if (new_udev) if (new_udev)
usbhsh_device_free(hpriv, new_udev); usbhsh_device_detach(hpriv, new_udev);
usbhsh_urb_enqueue_error_not_linked: usbhsh_urb_enqueue_error_not_linked:
dev_dbg(dev, "%s error\n", __func__); dev_dbg(dev, "%s error\n", __func__);
...@@ -831,7 +828,7 @@ static void usbhsh_endpoint_disable(struct usb_hcd *hcd, ...@@ -831,7 +828,7 @@ static void usbhsh_endpoint_disable(struct usb_hcd *hcd,
* free device * free device
*/ */
if (!usbhsh_device_has_endpoint(udev)) if (!usbhsh_device_has_endpoint(udev))
usbhsh_device_free(hpriv, udev); usbhsh_device_detach(hpriv, udev);
} }
static int usbhsh_hub_status_data(struct usb_hcd *hcd, char *buf) static int usbhsh_hub_status_data(struct usb_hcd *hcd, char *buf)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册