@@ -130,7 +130,6 @@ EXPORT_SYMBOL_GPL(ehci_cf_port_reset_rwsem);
130130#define HUB_DEBOUNCE_STEP 25
131131#define HUB_DEBOUNCE_STABLE 100
132132
133- static void hub_release (struct kref * kref );
134133static int usb_reset_and_verify_device (struct usb_device * udev );
135134static int hub_port_disable (struct usb_hub * hub , int port1 , int set_state );
136135static bool hub_port_warm_reset_required (struct usb_hub * hub , int port1 ,
@@ -720,14 +719,14 @@ static void kick_hub_wq(struct usb_hub *hub)
720719 */
721720 intf = to_usb_interface (hub -> intfdev );
722721 usb_autopm_get_interface_no_resume (intf );
723- kref_get ( & hub -> kref );
722+ hub_get ( hub );
724723
725724 if (queue_work (hub_wq , & hub -> events ))
726725 return ;
727726
728727 /* the work has already been scheduled */
729728 usb_autopm_put_interface_async (intf );
730- kref_put ( & hub -> kref , hub_release );
729+ hub_put ( hub );
731730}
732731
733732void usb_kick_hub_wq (struct usb_device * hdev )
@@ -1095,7 +1094,7 @@ static void hub_activate(struct usb_hub *hub, enum hub_activation_type type)
10951094 goto init2 ;
10961095 goto init3 ;
10971096 }
1098- kref_get ( & hub -> kref );
1097+ hub_get ( hub );
10991098
11001099 /* The superspeed hub except for root hub has to use Hub Depth
11011100 * value as an offset into the route string to locate the bits
@@ -1343,7 +1342,7 @@ static void hub_activate(struct usb_hub *hub, enum hub_activation_type type)
13431342 device_unlock (& hdev -> dev );
13441343 }
13451344
1346- kref_put ( & hub -> kref , hub_release );
1345+ hub_put ( hub );
13471346}
13481347
13491348/* Implement the continuations for the delays above */
@@ -1759,6 +1758,16 @@ static void hub_release(struct kref *kref)
17591758 kfree (hub );
17601759}
17611760
1761+ void hub_get (struct usb_hub * hub )
1762+ {
1763+ kref_get (& hub -> kref );
1764+ }
1765+
1766+ void hub_put (struct usb_hub * hub )
1767+ {
1768+ kref_put (& hub -> kref , hub_release );
1769+ }
1770+
17621771static unsigned highspeed_hubs ;
17631772
17641773static void hub_disconnect (struct usb_interface * intf )
@@ -1807,7 +1816,7 @@ static void hub_disconnect(struct usb_interface *intf)
18071816
18081817 onboard_hub_destroy_pdevs (& hub -> onboard_hub_devs );
18091818
1810- kref_put ( & hub -> kref , hub_release );
1819+ hub_put ( hub );
18111820}
18121821
18131822static bool hub_descriptor_is_sane (struct usb_host_interface * desc )
@@ -5934,7 +5943,7 @@ static void hub_event(struct work_struct *work)
59345943
59355944 /* Balance the stuff in kick_hub_wq() and allow autosuspend */
59365945 usb_autopm_put_interface (intf );
5937- kref_put ( & hub -> kref , hub_release );
5946+ hub_put ( hub );
59385947
59395948 kcov_remote_stop ();
59405949}
0 commit comments