summaryrefslogtreecommitdiff
path: root/drivers/usb/common/ulpi.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2016-10-04 06:17:35 +0300
committerLinus Torvalds <torvalds@linux-foundation.org>2016-10-04 06:17:35 +0300
commite6445f52d9c8b0e6557a45fa7d0e8e088d430a8c (patch)
tree0c9dbec3a5655beda1848b321c4d9dbeb27987a6 /drivers/usb/common/ulpi.c
parente6dce825fba05f447bd22c865e27233182ab3d79 (diff)
parentab21b63e8aedfc73565dd9cdd51eb338341177cb (diff)
downloadlinux-e6445f52d9c8b0e6557a45fa7d0e8e088d430a8c.tar.xz
Merge tag 'usb-4.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb
Pull usb/phy/extcon updates from Greg KH: "Here is the big USB, and PHY, and extcon, patchsets for 4.9-rc1. Full details are in the shortlog, but generally a lot of new hardware support, usb gadget updates, and Wolfram's great cleanup of USB error message handling, making the kernel image a tad bit smaller. All of this has been in linux-next with no reported issues" * tag 'usb-4.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (343 commits) Revert "usbtmc: convert to devm_kzalloc" USB: serial: cp210x: Add ID for a Juniper console usb: Kconfig: using select for USB_COMMON dependency bluetooth: bcm203x: don't print error when allocating urb fails mmc: host: vub300: don't print error when allocating urb fails usb: hub: change CLEAR_FEATURE to SET_FEATURE usb: core: Introduce a USB port LED trigger USB: bcma: drop Northstar PHY 2.0 initialization code usb: core: hcd: add missing header dependencies usb: musb: da8xx: fix error handling message in probe usb: musb: Fix session based PM for first invalid VBUS usb: musb: Fix PM runtime for disconnect after unconfigure musb: Export musb_root_disconnect for use in modules usb: misc: legousbtower: Fix NULL pointer deference cdc-acm: hardening against malicious devices Revert "usb: gadget: NCM: Protect dev->port_usb using dev->lock" include: extcon: Fix compilation error caused because of incomplete merge MAINTAINERS: add tree entry for USB Serial phy-twl4030-usb: initialize charging-related stuff via pm_runtime phy-twl4030-usb: better handle musb_mailbox() failure ...
Diffstat (limited to 'drivers/usb/common/ulpi.c')
-rw-r--r--drivers/usb/common/ulpi.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/drivers/usb/common/ulpi.c b/drivers/usb/common/ulpi.c
index 01c0c0477a9e..8b317702d761 100644
--- a/drivers/usb/common/ulpi.c
+++ b/drivers/usb/common/ulpi.c
@@ -21,13 +21,13 @@
int ulpi_read(struct ulpi *ulpi, u8 addr)
{
- return ulpi->ops->read(ulpi->ops, addr);
+ return ulpi->ops->read(ulpi->dev.parent, addr);
}
EXPORT_SYMBOL_GPL(ulpi_read);
int ulpi_write(struct ulpi *ulpi, u8 addr, u8 val)
{
- return ulpi->ops->write(ulpi->ops, addr, val);
+ return ulpi->ops->write(ulpi->dev.parent, addr, val);
}
EXPORT_SYMBOL_GPL(ulpi_write);
@@ -127,16 +127,17 @@ static struct device_type ulpi_dev_type = {
*
* Registers a driver with the ULPI bus.
*/
-int ulpi_register_driver(struct ulpi_driver *drv)
+int __ulpi_register_driver(struct ulpi_driver *drv, struct module *module)
{
if (!drv->probe)
return -EINVAL;
+ drv->driver.owner = module;
drv->driver.bus = &ulpi_bus;
return driver_register(&drv->driver);
}
-EXPORT_SYMBOL_GPL(ulpi_register_driver);
+EXPORT_SYMBOL_GPL(__ulpi_register_driver);
/**
* ulpi_unregister_driver - unregister a driver with the ULPI bus
@@ -156,6 +157,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 +177,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));
@@ -201,7 +203,8 @@ static int ulpi_register(struct device *dev, struct ulpi *ulpi)
* Allocates and registers a ULPI device and an interface for it. Called from
* the USB controller that provides the ULPI interface.
*/
-struct ulpi *ulpi_register_interface(struct device *dev, struct ulpi_ops *ops)
+struct ulpi *ulpi_register_interface(struct device *dev,
+ const struct ulpi_ops *ops)
{
struct ulpi *ulpi;
int ret;
@@ -211,7 +214,6 @@ struct ulpi *ulpi_register_interface(struct device *dev, struct ulpi_ops *ops)
return ERR_PTR(-ENOMEM);
ulpi->ops = ops;
- ops->dev = dev;
ret = ulpi_register(dev, ulpi);
if (ret) {