[PATCH] 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.
Signed-off-by: Adam Ford aford173@gmail.com
diff --git a/arch/arm/include/asm/ehci-omap.h b/arch/arm/include/asm/ehci-omap.h index f970bba937..2b51b5eb99 100644 --- a/arch/arm/include/asm/ehci-omap.h +++ b/arch/arm/include/asm/ehci-omap.h @@ -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_ */ diff --git a/drivers/usb/host/ehci-omap.c b/drivers/usb/host/ehci-omap.c index d5facf10e1..d34c0add4a 100644 --- a/drivers/usb/host/ehci-omap.c +++ b/drivers/usb/host/ehci-omap.c @@ -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;

On Sat, Feb 12, 2022 at 8:26 AM Adam Ford aford173@gmail.com wrote:
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.
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
Signed-off-by: Adam Ford aford173@gmail.com
diff --git a/arch/arm/include/asm/ehci-omap.h b/arch/arm/include/asm/ehci-omap.h index f970bba937..2b51b5eb99 100644 --- a/arch/arm/include/asm/ehci-omap.h +++ b/arch/arm/include/asm/ehci-omap.h @@ -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_ */ diff --git a/drivers/usb/host/ehci-omap.c b/drivers/usb/host/ehci-omap.c index d5facf10e1..d34c0add4a 100644 --- a/drivers/usb/host/ehci-omap.c +++ b/drivers/usb/host/ehci-omap.c @@ -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

On 2/14/22 01:05, Adam Ford wrote:
On Sat, Feb 12, 2022 at 8:26 AM Adam Ford aford173@gmail.com wrote:
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.
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.
It is not too late, but make sure you CC someone who can actually test this EHCI OMAP stuff.

On Sun, Feb 13, 2022 at 9:10 PM Marek Vasut marex@denx.de wrote:
On 2/14/22 01:05, Adam Ford wrote:
On Sat, Feb 12, 2022 at 8:26 AM Adam Ford aford173@gmail.com wrote:
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.
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.
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
participants (2)
-
Adam Ford
-
Marek Vasut