diff options
author | Tal Shorer <tal.shorer@gmail.com> | 2016-08-16 19:04:46 +0300 |
---|---|---|
committer | Felipe Balbi <felipe.balbi@linux.intel.com> | 2016-09-06 10:47:23 +0300 |
commit | 51b0ce387b43ba8ed532e6f9f215d891e1899e0a (patch) | |
tree | 9a2149096fb0549ad3baceaec6d15c32691be514 /drivers/usb/common/ulpi.c | |
parent | 65e1ff7f4b5b37d84c058a09d60ca2a0acff7cfd (diff) | |
download | linux-51b0ce387b43ba8ed532e6f9f215d891e1899e0a.tar.bz2 |
usb: ulpi: move setting of ulpi->dev parent up in ulpi_register()
Once ulpi operations use the parent device directly, this will be
needed during the operations used in ulpi_register() itself, so set
the parent field before calling any ulpi operations.
Acked-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Tal Shorer <tal.shorer@gmail.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Diffstat (limited to 'drivers/usb/common/ulpi.c')
-rw-r--r-- | drivers/usb/common/ulpi.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/usb/common/ulpi.c b/drivers/usb/common/ulpi.c index 01c0c0477a9e..d1f419c7cddb 100644 --- a/drivers/usb/common/ulpi.c +++ b/drivers/usb/common/ulpi.c @@ -156,6 +156,8 @@ static int ulpi_register(struct device *dev, struct ulpi *ulpi) { int ret; + ulpi->dev.parent = dev; /* needed early for ops */ + /* Test the interface */ ret = ulpi_write(ulpi, ULPI_SCRATCH, 0xaa); if (ret < 0) @@ -174,7 +176,6 @@ static int ulpi_register(struct device *dev, struct ulpi *ulpi) ulpi->id.product = ulpi_read(ulpi, ULPI_PRODUCT_ID_LOW); ulpi->id.product |= ulpi_read(ulpi, ULPI_PRODUCT_ID_HIGH) << 8; - ulpi->dev.parent = dev; ulpi->dev.bus = &ulpi_bus; ulpi->dev.type = &ulpi_dev_type; dev_set_name(&ulpi->dev, "%s.ulpi", dev_name(dev)); |