lkml.org 
[lkml]   [2015]   [Jan]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH 6/8] usb: dwc3: add ULPI interface support
    Hi,

    On Fri, Jan 23, 2015 at 05:12:56PM +0200, Heikki Krogerus wrote:
    > +int dwc3_ulpi_init(struct dwc3 *dwc)
    > +{
    > + u32 reg;
    > +
    > + /* First check USB2 PHY interface type */
    > + switch (DWC3_GHWPARAMS3_HSPHY_IFC(dwc->hwparams.hwparams3)) {
    > + case DWC3_GHWPARAMS3_HSPHY_IFC_UTMI_ULPI:
    > + /* Select ULPI Interface */
    > + reg = dwc3_readl(dwc->regs, DWC3_GUSB2PHYCFG(0));
    > + reg |= DWC3_GUSB2PHYCFG_ULPI_UTMI;
    > + dwc3_writel(dwc->regs, DWC3_GUSB2PHYCFG(0), reg);
    > + /* FALLTHROUGH */
    > + case DWC3_GHWPARAMS3_HSPHY_IFC_ULPI:
    > + break;
    > + default:
    > + return 0;
    > + }
    > +
    > + /* Register the interface */
    > + dwc->ulpi = ulpi_register_interface(dwc->dev, &dwc3_ulpi);
    > + if (IS_ERR(dwc->ulpi)) {

    so, this will only build and link if DWC3_ULPI is enabled, in case of
    error you return early...

    > + dev_err(dwc->dev, "failed to register ULPI interface");
    > + return PTR_ERR(dwc->ulpi);
    > + }
    > +
    > + return 0;
    > +}
    > +
    > +void dwc3_ulpi_exit(struct dwc3 *dwc)
    > +{
    > + if (dwc->ulpi) {

    ... looks like this branch is unnecessary.

    --
    balbi
    [unhandled content-type:application/pgp-signature]
    \
     
     \ /
      Last update: 2015-01-23 17:41    [W:4.251 / U:0.060 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site