> -----Original Message----- > From: Alan Stern [mailto:stern@xxxxxxxxxxxxxxxxxxx] > Sent: Tuesday, October 05, 2010 9:17 AM > To: Uwe Kleine-KÃnig > Cc: linux-usb@xxxxxxxxxxxxxxx; Eric BÃnard; Wolfram Sang; Daniel Mack; > Nguyen Dinh-R00091; Valentin Longchamp; Sascha Hauer > Subject: Re: [PATCH] [RFC] USB: EHCI: mark several functions as maybe > unused > > On Tue, 5 Oct 2010, [UTF-8] Uwe Kleine-KÃÂnig wrote: > > > Hello, > > > > I don't know much about usb drivers in general or ehci, but the > warnings > > below clutter our auto build logs since quite some time. > > > > Maybe someone can clearify if it's OK for the mxc driver not to use the > > functions marked by my patch?! > > > > Best regards > > Uwe > > > > --------------------- >8 --------------------- > > - ehci_lpm_check and ehci_lpm_set_da are only used in > ehci_update_device > > defined in drivers/usb/host/ehci-pci.c. > > - ehci_adjust_port_wakeup_flags (disguised as > > ehci_prepare_ports_for_controller_suspend and > > ehci_prepare_ports_for_controller_resume), > ehci_clear_tt_buffer_complete > > and ehci_endpoint_reset are used in several drivers, but not in ehci- > mxc.c > > > > This fixes the following warnings: > > > > drivers/usb/host/ehci-lpm.c:21: warning: 'ehci_lpm_set_da' > defined but not used > > drivers/usb/host/ehci-lpm.c:41: warning: 'ehci_lpm_check' > defined but not used > > drivers/usb/host/ehci-q.c:148: warning: > 'ehci_clear_tt_buffer_complete' defined but not used > > drivers/usb/host/ehci-hcd.c:1088: warning: > 'ehci_endpoint_reset' defined but not used > > drivers/usb/host/ehci-hub.c:111: warning: > 'ehci_adjust_port_wakeup_flags' defined but not used > > > > when compiling with USB_EHCI_MXC. > > I have no idea about ehci_lpm_check or ehci_lpm_set_da. From a cursory > inspection, it appears that this file should be included only in builds > where it gets used (currently only in PCI). > > ehci_adjust_port_wakeup_flags should be used in every driver that > supports suspend & resume. But since your driver doesn't, marking them > __maybe_unused is okay. > > ehci_clear_tt_buffer_complete and ehci_endpoint_reset must be used by > every EHCI driver. The correct fix is to add them to your driver's > hc_driver structure. > > Alan Stern > Hi Uwe, Currently our internal port of ehci is using ehci_clear_tt_buffer_complete and ehci_endpoint_reset per Alan's recommendation. I will look into adding it to the ehci-mxc hc_driver structure. On the point of the ehci_adjust_port_wakeup_flags, I am starting to at adding suspend/resume support in the ehci_mxc driver. But until that patch is ready, the _unused_ flag is ok. My patch could remove them when it gets created. Thanks, Dinh ÿô.nÇ·®+%˱é¥wÿº{.nÇ·¥{±þë)íèjg¬±¨¶Ýjÿ¾«þG«é¸¢·¦j:+v¨wèm¶ÿþø®w¥þ࣢·hâÿÙ