Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1452754

[PATCH 1/5] usb: ulpi: move setting of ulpi->dev parent up in ulpi_register()

From Tal Shorer <tal.shorer@gmail.com>
Newsgroups linux.kernel
Subject [PATCH 1/5] usb: ulpi: move setting of ulpi->dev parent up in ulpi_register()
Date 2016-07-31 01:30 +0200
Message-ID <s0LRE-Ch-5@gated-at.bofh.it> (permalink)
References <s0LRD-Ch-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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.

Signed-off-by: Tal Shorer <tal.shorer@gmail.com>
---
 drivers/usb/common/ulpi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/usb/common/ulpi.c b/drivers/usb/common/ulpi.c
index 01c0c04..d1f419c 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));
-- 
2.7.4

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 0/5] usb: ulpi: remove "dev" field from struct ulpi_ops Tal Shorer <tal.shorer@gmail.com> - 2016-07-31 01:30 +0200
  [PATCH 1/5] usb: ulpi: move setting of ulpi->dev parent up in ulpi_register() Tal Shorer <tal.shorer@gmail.com> - 2016-07-31 01:30 +0200
  [PATCH 2/5] usb: ulpi: change operations api to pass parent device directly Tal Shorer <tal.shorer@gmail.com> - 2016-07-31 01:30 +0200
  [PATCH 4/5] usb: ulpi: make ops struct constant Tal Shorer <tal.shorer@gmail.com> - 2016-07-31 01:30 +0200
  [PATCH 3/5] usb: ulpi: remove "dev" field from struct ulpi_ops Tal Shorer <tal.shorer@gmail.com> - 2016-07-31 01:30 +0200
  [PATCH 5/5] usb: dwc3: ulpi: make dwc3_ulpi_ops constant Tal Shorer <tal.shorer@gmail.com> - 2016-07-31 01:30 +0200

csiph-web