Subject: Re: [PATCH 2/3] USB: add of_platform glue driver for FSL USB DR controller

From: Anton Vorontsov <[email-masked]>
Date: Wed, 28 Jul 2010 12:28:34 +0400

On Wed, Jul 28, 2010 at 02:16:08AM -0600, Grant Likely wrote:
[...]
> > +static int __devinit fsl_usb2_mph_dr_of_probe(struct of_device *ofdev,
> > +                                          const struct of_device_id *match)
> > +{
> > +       struct device_node *np = ofdev->dev.of_node;
> > +       struct platform_device *usb_dev;
> > +       struct fsl_usb2_platform_data data, *pdata;
> > +       struct fsl_usb2_dev_data *dev_data;
> > +       const unsigned char *prop;
> > +       static unsigned int idx;
> > +       int i;
> > +
> > +       if (!of_device_is_available(np))
> > +               return -ENODEV;
> 
> What is this for?

USB pins/clocks might be muxed away to other peripherals, like
eSDHC. In such cases firmware marks USB as unavailable (status
= "disabled").

If you try to access USB while it is disabled the SOC will hang.

-- 
Anton Vorontsov
email: [email-masked]
irc://irc.freenode.net/bd2