Hi, On Tue, May 15, 2012 at 12:43:00PM +0800, Yu Xu wrote: > Hi Balbi, > > 2012/5/14 Felipe Balbi <balbi@xxxxxx>: > > On Mon, May 14, 2012 at 06:11:11PM +0800, Yu Xu wrote: > >> Hi Balbi, > >> > >> > >> >> + dev_err(&dev->dev, "failed to allocate memory for u3d\n"); > >> >> + retval = -ENOMEM; > >> >> + goto err_alloc_private; > >> >> + } > >> >> + > >> >> + spin_lock_init(&u3d->lock); > >> >> + > >> >> + platform_set_drvdata(dev, u3d); > >> >> + > >> >> + u3d->dev = dev; > >> >> + u3d->pdata = dev->dev.platform_data; > >> > > >> > I believe pdata could be freed after init, no ? > >> > > >> Actually, pdata is still used after init, such as pdata->phy_init/phy_deinit. > > > > k, fair enough. > > > >> >> + u3d->clk = clk_get(&dev->dev, pdata->clkname[0]); > >> >> + if (IS_ERR(u3d->clk)) { > >> >> + retval = PTR_ERR(u3d->clk); > >> >> + goto err_get_clk; > >> >> + } > >> >> + > >> >> + r = platform_get_resource_byname(u3d->dev, IORESOURCE_MEM, "capregs"); > >> >> + if (r == NULL) { > >> >> + dev_err(&dev->dev, "no I/O memory resource defined\n"); > >> >> + retval = -ENODEV; > >> >> + goto err_get_cap_regs; > >> >> + } > >> >> + > >> >> + u3d->cap_regs = (struct mv_u3d_cap_regs __iomem *) > >> >> + ioremap(r->start, resource_size(r)); > >> >> + if (u3d->cap_regs == NULL) { > >> >> + dev_err(&dev->dev, "failed to map I/O memory\n"); > >> >> + retval = -EBUSY; > >> >> + goto err_map_cap_regs; > >> >> + } else { > >> >> + dev_dbg(&dev->dev, "cap_regs address: 0x%x/0x%x\n", > >> >> + (unsigned int)r->start, (unsigned int)u3d->cap_regs); > >> >> + } > >> >> + > >> >> + u3d->phy_regs = (u32)u3d->cap_regs + USB3_PHY_OFFSET; > >> > > >> > PHY shouldn't be handled by this driver. You need to write a PHY driver > >> > for controlling the PHY, no ? > >> > > >> Yes, I'll have another patch for PHY. > > > > Then, why even add this here ? > > > Here we just get the PHY register address, but no PHY operation. > Do you mean we need to put it to the PHY driver? yes. -- balbi
Attachment:
signature.asc
Description: Digital signature