aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/renesas_usbhs
diff options
context:
space:
mode:
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>2011-10-31 03:49:09 -0400
committerFelipe Balbi <balbi@ti.com>2011-12-12 04:45:10 -0500
commit7aac8d1537b1fd1a9e39bd16edcd6728c19f8dd5 (patch)
tree7753f13aa6f376f4389e7a5c608eb9c72baaaf91 /drivers/usb/renesas_usbhs
parent4825093e9d0692a2a1f1615ab69246ac07b17f2f (diff)
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: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/renesas_usbhs')
-rw-r--r--drivers/usb/renesas_usbhs/mod_host.c19
1 files changed, 8 insertions, 11 deletions
diff --git a/drivers/usb/renesas_usbhs/mod_host.c b/drivers/usb/renesas_usbhs/mod_host.c
index 11c615d8d0d2..182bdb8e45ec 100644
--- a/drivers/usb/renesas_usbhs/mod_host.c
+++ b/drivers/usb/renesas_usbhs/mod_host.c
@@ -220,7 +220,7 @@ static int usbhsh_device_has_endpoint(struct usbhsh_device *udev)
220 return !list_empty(&udev->ep_list_head); 220 return !list_empty(&udev->ep_list_head);
221} 221}
222 222
223static struct usbhsh_device *usbhsh_device_alloc(struct usbhsh_hpriv *hpriv, 223static struct usbhsh_device *usbhsh_device_attach(struct usbhsh_hpriv *hpriv,
224 struct urb *urb) 224 struct urb *urb)
225{ 225{
226 struct usbhsh_device *udev = NULL; 226 struct usbhsh_device *udev = NULL;
@@ -307,7 +307,7 @@ static struct usbhsh_device *usbhsh_device_alloc(struct usbhsh_hpriv *hpriv,
307 return udev; 307 return udev;
308} 308}
309 309
310static void usbhsh_device_free(struct usbhsh_hpriv *hpriv, 310static void usbhsh_device_detach(struct usbhsh_hpriv *hpriv,
311 struct usbhsh_device *udev) 311 struct usbhsh_device *udev)
312{ 312{
313 struct usb_hcd *hcd = usbhsh_hpriv_to_hcd(hpriv); 313 struct usb_hcd *hcd = usbhsh_hpriv_to_hcd(hpriv);
@@ -744,7 +744,7 @@ static int usbhsh_urb_enqueue(struct usb_hcd *hcd,
744 struct device *dev = usbhs_priv_to_dev(priv); 744 struct device *dev = usbhs_priv_to_dev(priv);
745 struct usb_device *usbv = usbhsh_urb_to_usbv(urb); 745 struct usb_device *usbv = usbhsh_urb_to_usbv(urb);
746 struct usb_host_endpoint *ep = urb->ep; 746 struct usb_host_endpoint *ep = urb->ep;
747 struct usbhsh_device *udev, *new_udev = NULL; 747 struct usbhsh_device *new_udev = NULL;
748 int is_dir_in = usb_pipein(urb->pipe); 748 int is_dir_in = usb_pipein(urb->pipe);
749 749
750 int ret; 750 int ret;
@@ -756,15 +756,12 @@ static int usbhsh_urb_enqueue(struct usb_hcd *hcd,
756 goto usbhsh_urb_enqueue_error_not_linked; 756 goto usbhsh_urb_enqueue_error_not_linked;
757 757
758 /* 758 /*
759 * get udev 759 * attach udev if needed
760 */ 760 */
761 udev = usbhsh_usbv_to_udev(usbv); 761 if (!usbhsh_usbv_to_udev(usbv)) {
762 if (!udev) { 762 new_udev = usbhsh_device_attach(hpriv, urb);
763 new_udev = usbhsh_device_alloc(hpriv, urb);
764 if (!new_udev) 763 if (!new_udev)
765 goto usbhsh_urb_enqueue_error_not_linked; 764 goto usbhsh_urb_enqueue_error_not_linked;
766
767 udev = new_udev;
768 } 765 }
769 766
770 /* 767 /*
@@ -788,7 +785,7 @@ static int usbhsh_urb_enqueue(struct usb_hcd *hcd,
788 785
789usbhsh_urb_enqueue_error_free_device: 786usbhsh_urb_enqueue_error_free_device:
790 if (new_udev) 787 if (new_udev)
791 usbhsh_device_free(hpriv, new_udev); 788 usbhsh_device_detach(hpriv, new_udev);
792usbhsh_urb_enqueue_error_not_linked: 789usbhsh_urb_enqueue_error_not_linked:
793 790
794 dev_dbg(dev, "%s error\n", __func__); 791 dev_dbg(dev, "%s error\n", __func__);
@@ -831,7 +828,7 @@ static void usbhsh_endpoint_disable(struct usb_hcd *hcd,
831 * free device 828 * free device
832 */ 829 */
833 if (!usbhsh_device_has_endpoint(udev)) 830 if (!usbhsh_device_has_endpoint(udev))
834 usbhsh_device_free(hpriv, udev); 831 usbhsh_device_detach(hpriv, udev);
835} 832}
836 833
837static int usbhsh_hub_status_data(struct usb_hcd *hcd, char *buf) 834static int usbhsh_hub_status_data(struct usb_hcd *hcd, char *buf)