Re: [PATCH] usb: ulpi: Define a *otg_ulpi_create no-op

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 03/20/13 15:35, Fabio Estevam wrote:
> From: Fabio Estevam <fabio.estevam@xxxxxxxxxxxxx>
> 
> 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'

Is this patch fixes both undefined references?
It does not look so..
If it fixes only the first one, I would suggest adjusting the commit message.

> 
> Fix this by providing a no-op definition of *otg_ulpi_create for the case when 
> CONFIG_USB_ULPI is not defined.
> 
> Signed-off-by: Fabio Estevam <fabio.estevam@xxxxxxxxxxxxx>
> ---
>  include/linux/usb/ulpi.h |    8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/include/linux/usb/ulpi.h b/include/linux/usb/ulpi.h
> index 6f033a4..5c295c2 100644
> --- a/include/linux/usb/ulpi.h
> +++ b/include/linux/usb/ulpi.h
> @@ -181,8 +181,16 @@
>  
>  /*-------------------------------------------------------------------------*/
>  
> +#if IS_ENABLED(CONFIG_USB_ULPI)
>  struct usb_phy *otg_ulpi_create(struct usb_phy_io_ops *ops,
>  					unsigned int flags);
> +#else
> +static inline struct usb_phy *otg_ulpi_create(struct usb_phy_io_ops *ops,
> +					      unsigned int flags)
> +{
> +	return NULL;

Would ERR_PTR(-ENXIO) do better here?

> +}
> +#endif
>  
>  #ifdef CONFIG_USB_ULPI_VIEWPORT
>  /* access ops for controllers with a viewport register */
> 

-- 
Regards,
Igor.
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux