@@ -2795,7 +2795,6 @@ int usb_add_hcd(struct usb_hcd *hcd,
2795
2795
{
2796
2796
int retval ;
2797
2797
struct usb_device * rhdev ;
2798
- struct usb_hcd * shared_hcd ;
2799
2798
2800
2799
if (!hcd -> skip_phy_initialization && usb_hcd_is_primary_hcd (hcd )) {
2801
2800
hcd -> phy_roothub = usb_phy_roothub_alloc (hcd -> self .sysdev );
@@ -2956,26 +2955,13 @@ int usb_add_hcd(struct usb_hcd *hcd,
2956
2955
goto err_hcd_driver_start ;
2957
2956
}
2958
2957
2959
- /* starting here, usbcore will pay attention to the shared HCD roothub */
2960
- shared_hcd = hcd -> shared_hcd ;
2961
- if (!usb_hcd_is_primary_hcd (hcd ) && shared_hcd && HCD_DEFER_RH_REGISTER (shared_hcd )) {
2962
- retval = register_root_hub (shared_hcd );
2963
- if (retval != 0 )
2964
- goto err_register_root_hub ;
2965
-
2966
- if (shared_hcd -> uses_new_polling && HCD_POLL_RH (shared_hcd ))
2967
- usb_hcd_poll_rh_status (shared_hcd );
2968
- }
2969
-
2970
2958
/* starting here, usbcore will pay attention to this root hub */
2971
- if (!HCD_DEFER_RH_REGISTER (hcd )) {
2972
- retval = register_root_hub (hcd );
2973
- if (retval != 0 )
2974
- goto err_register_root_hub ;
2959
+ retval = register_root_hub (hcd );
2960
+ if (retval != 0 )
2961
+ goto err_register_root_hub ;
2975
2962
2976
- if (hcd -> uses_new_polling && HCD_POLL_RH (hcd ))
2977
- usb_hcd_poll_rh_status (hcd );
2978
- }
2963
+ if (hcd -> uses_new_polling && HCD_POLL_RH (hcd ))
2964
+ usb_hcd_poll_rh_status (hcd );
2979
2965
2980
2966
return retval ;
2981
2967
@@ -3013,7 +2999,6 @@ EXPORT_SYMBOL_GPL(usb_add_hcd);
3013
2999
void usb_remove_hcd (struct usb_hcd * hcd )
3014
3000
{
3015
3001
struct usb_device * rhdev = hcd -> self .root_hub ;
3016
- bool rh_registered ;
3017
3002
3018
3003
dev_info (hcd -> self .controller , "remove, state %x\n" , hcd -> state );
3019
3004
@@ -3024,7 +3009,6 @@ void usb_remove_hcd(struct usb_hcd *hcd)
3024
3009
3025
3010
dev_dbg (hcd -> self .controller , "roothub graceful disconnect\n" );
3026
3011
spin_lock_irq (& hcd_root_hub_lock );
3027
- rh_registered = hcd -> rh_registered ;
3028
3012
hcd -> rh_registered = 0 ;
3029
3013
spin_unlock_irq (& hcd_root_hub_lock );
3030
3014
@@ -3034,8 +3018,7 @@ void usb_remove_hcd(struct usb_hcd *hcd)
3034
3018
cancel_work_sync (& hcd -> died_work );
3035
3019
3036
3020
mutex_lock (& usb_bus_idr_lock );
3037
- if (rh_registered )
3038
- usb_disconnect (& rhdev ); /* Sets rhdev to NULL */
3021
+ usb_disconnect (& rhdev ); /* Sets rhdev to NULL */
3039
3022
mutex_unlock (& usb_bus_idr_lock );
3040
3023
3041
3024
/*
0 commit comments