Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0b25a2f0 authored by Ajay Agarwal's avatar Ajay Agarwal
Browse files

USB: HCD: Add dummy functions when host mode disabled



If CONFIG_USB is disabled in the defconfig and some hcd
function is invoked by other drivers, then it can lead
to compilation failure. Fix this by adding appropriate
dummy functions in case of CONFIG_USB disabled.

Change-Id: I3e4110cd90c926af9ee81b6f981889c53ae5b039
Signed-off-by: default avatarAjay Agarwal <ajaya@codeaurora.org>
parent 16806c73
Loading
Loading
Loading
Loading
+23 −12
Original line number Diff line number Diff line
@@ -434,9 +434,6 @@ extern struct usb_hcd *usb_create_shared_hcd(const struct hc_driver *driver,
extern struct usb_hcd *usb_get_hcd(struct usb_hcd *hcd);
extern void usb_put_hcd(struct usb_hcd *hcd);
extern int usb_hcd_is_primary_hcd(struct usb_hcd *hcd);
extern int usb_add_hcd(struct usb_hcd *hcd,
		unsigned int irqnum, unsigned long irqflags);
extern void usb_remove_hcd(struct usb_hcd *hcd);
extern int usb_hcd_find_raw_port_number(struct usb_hcd *hcd, int port1);

struct platform_device;
@@ -636,15 +633,6 @@ extern int hcd_bus_suspend(struct usb_device *rhdev, pm_message_t msg);
extern int hcd_bus_resume(struct usb_device *rhdev, pm_message_t msg);
#endif /* CONFIG_PM */

#ifdef CONFIG_PM_RUNTIME
extern void usb_hcd_resume_root_hub(struct usb_hcd *hcd);
#else
static inline void usb_hcd_resume_root_hub(struct usb_hcd *hcd)
{
	return;
}
#endif /* CONFIG_PM_RUNTIME */

/*-------------------------------------------------------------------------*/

#if defined(CONFIG_USB_MON) || defined(CONFIG_USB_MON_MODULE)
@@ -710,6 +698,29 @@ extern struct rw_semaphore ehci_cf_port_reset_rwsem;
#define USB_EHCI_LOADED		2
extern unsigned long usb_hcds_loaded;

#ifdef CONFIG_USB
extern int usb_add_hcd(struct usb_hcd *hcd,
		unsigned int irqnum, unsigned long irqflags);
extern void usb_remove_hcd(struct usb_hcd *hcd);
#ifdef CONFIG_PM_RUNTIME
extern void usb_hcd_resume_root_hub(struct usb_hcd *hcd);
#else
static inline void usb_hcd_resume_root_hub(struct usb_hcd *hcd) {}
#endif /* CONFIG_PM_RUNTIME */

#else  /* CONFIG_USB */

static inline int usb_add_hcd(struct usb_hcd *hcd,
		unsigned int irqnum, unsigned long irqflags)
{
	return 0;
}

static inline void usb_remove_hcd(struct usb_hcd *hcd) {}
static inline void usb_hcd_resume_root_hub(struct usb_hcd *hcd) {}

#endif /* CONFIG_USB */

#endif /* __KERNEL__ */

#endif /* __USB_CORE_HCD_H */