Skip to content

Commit 903b39e

Browse files
committed
usb: ohci-omap: avoid unused-variable warning
The dead code removal has led to 'need_transceiver' not being used at all when OTG support is disabled: drivers/usb/host/ohci-omap.c: In function 'ohci_omap_reset': drivers/usb/host/ohci-omap.c:99:33: error: unused variable 'need_transceiver' [-Werror=unused-variable] 99 | int need_transceiver = (config->otg != 0); Change the #ifdef check into an IS_ENABLED() check to make the code more readable and let the compiler see where it is used. Fixes: 8825acd ("ARM: omap1: remove dead code") Reviewed-by: Greg Kroah-Hartman <[email protected]> Acked-by: Alan Stern <[email protected]> Signed-off-by: Arnd Bergmann <[email protected]>
1 parent ae4cc02 commit 903b39e

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

drivers/usb/host/ohci-omap.c

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,6 @@ static void omap_ohci_clock_power(struct ohci_omap_priv *priv, int on)
6767
}
6868
}
6969

70-
#ifdef CONFIG_USB_OTG
71-
7270
static void start_hnp(struct ohci_hcd *ohci)
7371
{
7472
struct usb_hcd *hcd = ohci_to_hcd(ohci);
@@ -87,8 +85,6 @@ static void start_hnp(struct ohci_hcd *ohci)
8785
local_irq_restore(flags);
8886
}
8987

90-
#endif
91-
9288
/*-------------------------------------------------------------------------*/
9389

9490
static int ohci_omap_reset(struct usb_hcd *hcd)
@@ -111,8 +107,7 @@ static int ohci_omap_reset(struct usb_hcd *hcd)
111107
if (config->ocpi_enable)
112108
config->ocpi_enable();
113109

114-
#ifdef CONFIG_USB_OTG
115-
if (need_transceiver) {
110+
if (IS_ENABLED(CONFIG_USB_OTG) && need_transceiver) {
116111
hcd->usb_phy = usb_get_phy(USB_PHY_TYPE_USB2);
117112
if (!IS_ERR_OR_NULL(hcd->usb_phy)) {
118113
int status = otg_set_host(hcd->usb_phy->otg,
@@ -129,7 +124,6 @@ static int ohci_omap_reset(struct usb_hcd *hcd)
129124
hcd->skip_phy_initialization = 1;
130125
ohci->start_hnp = start_hnp;
131126
}
132-
#endif
133127

134128
omap_ohci_clock_power(priv, 1);
135129

0 commit comments

Comments
 (0)