Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

usb: ulpi: Define a *otg_ulpi_create no-op

Building a kernel for imx_v4_v5_defconfig with CONFIG_USB_ULPI disabled, results
in the following error:

arch/arm/mach-imx/built-in.o: In function 'pca100_init':
platform-mx2-emma.c:(.init.text+0x6788): undefined reference to 'otg_ulpi_create'
platform-mx2-emma.c:(.init.text+0x682c): undefined reference to 'mxc_ulpi_access_ops'

Fix this by providing a no-op definition of *otg_ulpi_create for the case when
CONFIG_USB_ULPI is not defined.

Acked-by: Igor Grinberg <grinberg@compulab.co.il>
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>

authored by

Fabio Estevam and committed by
Felipe Balbi
7fa4cd1a 3416905b

+8
+8
include/linux/usb/ulpi.h
··· 181 181 182 182 /*-------------------------------------------------------------------------*/ 183 183 184 + #if IS_ENABLED(CONFIG_USB_ULPI) 184 185 struct usb_phy *otg_ulpi_create(struct usb_phy_io_ops *ops, 185 186 unsigned int flags); 187 + #else 188 + static inline struct usb_phy *otg_ulpi_create(struct usb_phy_io_ops *ops, 189 + unsigned int flags) 190 + { 191 + return NULL; 192 + } 193 + #endif 186 194 187 195 #ifdef CONFIG_USB_ULPI_VIEWPORT 188 196 /* access ops for controllers with a viewport register */