usb: ehci-omap: Drop dead code
Subsystems (4)
PATCH 1/1 usb: ehci-omap: Drop dead code
omap_ehci_hcd_stop appears to be dead code, and omap_ehci_hcd_init is only called by the probe function, so it can be static to that function. Remove both from the header along with some additional checking for DM_USB.
arch/arm/include/asm/ehci-omap.h +0 -13
@@ -123,17 +123,4 @@ struct omap_ehci { u32 insreg08; /* 0xb0 */ }; -#if !CONFIG_IS_ENABLED (DM_USB ) || !CONFIG_IS_ENABLED (OF_CONTROL ) -/* -* FIXME: forward declaration of this structs needed because omap got the -* ehci implementation backwards. move out ehci_hcd_x from board files -*/ -struct ehci_hccr ; -struct ehci_hcor ; - -int omap_ehci_hcd_init (int index,struct omap_usbhs_board_data *usbhs_pdata, -struct ehci_hccr **hccr,struct ehci_hcor **hcor); -int omap_ehci_hcd_stop (void ); -#endif -#endif /* _OMAP_COMMON_EHCI_H_ */
drivers/usb/host/ehci-omap.c +1 -16
@@ -163,27 +163,12 @@ static inline void omap_ehci_phy_reset(int on, int delay)#define omap_ehci_phy_reset (on, delay) do {} while (0)#endif -/* Reset is needed otherwise the kernel-driver will throw an error. */ -int omap_ehci_hcd_stop (void ) -{ -debug ("Resetting OMAP EHCI\n" ); -omap_ehci_phy_reset (1 ,0 ); - -if (omap_uhh_reset () <0 ) -return -1 ; - -if (omap_ehci_tll_reset () <0 ) -return -1 ; - -return 0 ; -} -/* * Initialize the OMAP EHCI controller and PHY. * Based on "drivers/usb/host/ehci-omap.c" from Linux 3.1 * See there for additional Copyrights. */ -int omap_ehci_hcd_init (int index,struct omap_usbhs_board_data *usbhs_pdata) +static int omap_ehci_hcd_init (int index,struct omap_usbhs_board_data *usbhs_pdata) {int ret;unsigned int i, reg =0 , rev =0 ;
Signature · 1 line
2.32.0
Quoted 6 lines · Adam Ford
omap_ehci_hcd_stopappears to be dead code, andomap_ehci_hcd_initis only called by the probe function, so it can be static to that function. Remove both from the header along with some additional checking forDM_USB.
If it's not too late to hold off on this, I'd like to resend it as part of a larger series. I have a whole series based on this that converts the driver to use the phy subsystem in an effort to remove the OMAP_EHCI_PHYx_RESET_GPIO from Kconfig that makes the driver more device-tree friendly. Rather than doing this and waiting for the reviews, merge, etc. then doing the follow-up, I'd like to just send the series to avoid confusion as to any dependent patches.
If it's too late, I'll just send the subsequent patches after this one gets reviewed and merged.
adam
Quoted 60 lines
Signed-off-by Adam Ford <[email protected]>arch/arm/include/asm/ehci-omap.h +0
-13@@ -123,17 +123,4 @@ struct omap_ehci { u32 insreg08; /* 0xb0 */ }; -#if !CONFIG_IS_ENABLED (DM_USB ) || !CONFIG_IS_ENABLED (OF_CONTROL ) -/* -* FIXME: forward declaration of this structs needed because omap got the -* ehci implementation backwards. move out ehci_hcd_x from board files -*/ -struct ehci_hccr ; -struct ehci_hcor ; - -int omap_ehci_hcd_init (int index,struct omap_usbhs_board_data *usbhs_pdata, -struct ehci_hccr **hccr,struct ehci_hcor **hcor); -int omap_ehci_hcd_stop (void ); -#endif -#endif /* _OMAP_COMMON_EHCI_H_ */ drivers/usb/host/ehci-omap.c +1
-17@@ -163,27 +163,12 @@ static inline void omap_ehci_phy_reset(int on, int delay)#define omap_ehci_phy_reset (on, delay) do {} while (0)#endif -/* Reset is needed otherwise the kernel-driver will throw an error. */ -int omap_ehci_hcd_stop (void ) -{ -debug ("Resetting OMAP EHCI\n" ); -omap_ehci_phy_reset (1 ,0 ); - -if (omap_uhh_reset () <0 ) -return -1 ; - -if (omap_ehci_tll_reset () <0 ) -return -1 ; - -return 0 ; -} -/* * Initialize the OMAP EHCI controller and PHY. * Based on "drivers/usb/host/ehci-omap.c" from Linux 3.1 * See there for additional Copyrights. */ -int omap_ehci_hcd_init (int index,struct omap_usbhs_board_data *usbhs_pdata) +static int omap_ehci_hcd_init (int index,struct omap_usbhs_board_data *usbhs_pdata) {int ret;unsigned int i, reg =0 , rev =0 ; --2.32.0
Quoted 16 lines · Adam Ford
Quoted 6 lines · Adam Ford
omap_ehci_hcd_stopappears to be dead code, andomap_ehci_hcd_initis only called by the probe function, so it can be static to that function. Remove both from the header along with some additional checking forDM_USB.If it's not too late to hold off on this, I'd like to resend it as part of a larger series. I have a whole series based on this that converts the driver to use the phy subsystem in an effort to remove the
OMAP_EHCI_PHYx_RESET_GPIOfromKconfigthat makes the driver more device-tree friendly. Rather than doing this and waiting for the reviews, merge, etc. then doing the follow-up, I'd like to just send the series to avoid confusion as to any dependent patches.
Quoted 2 lines
If it's too late, I'll just send the subsequent patches after this one gets reviewed and merged.
It is not too late, but make sure you CC someone who can actually test this EHCI OMAP stuff.
Quoted 18 lines · Marek Vasut
Quoted 16 lines · Adam Ford
Quoted 6 lines · Adam Ford
omap_ehci_hcd_stopappears to be dead code, andomap_ehci_hcd_initis only called by the probe function, so it can be static to that function. Remove both from the header along with some additional checking forDM_USB.If it's not too late to hold off on this, I'd like to resend it as part of a larger series. I have a whole series based on this that converts the driver to use the phy subsystem in an effort to remove the
OMAP_EHCI_PHYx_RESET_GPIOfromKconfigthat makes the driver more device-tree friendly. Rather than doing this and waiting for the reviews, merge, etc. then doing the follow-up, I'd like to just send the series to avoid confusion as to any dependent patches.
Quoted 5 lines
Quoted 2 lines
If it's too late, I'll just send the subsequent patches after this one gets reviewed and merged.
It is not too late, but make sure you CC someone who can actually test this EHCI OMAP stuff.
I have an OMAP35, DM37 and an AM3517 that I'll be using for testing the OMAP3's. So far it works on the DM3730. I haven't confirmed the others yet. I'll CC any of the maintainers for the defconfig files that enable the driver or OMAP_EHCI_PHYx_RESET_GPIO.
adam