diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2015-05-28 08:27:02 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2015-05-28 08:27:02 +0200 |
commit | f13f1c269ebffca25697deb420cce64b099d66b5 (patch) | |
tree | 7303f16dd2c4d3fb1b19a43231a9d00dade2f78e /drivers/usb/musb | |
parent | e8f4eaceddbdf7347584871f310dd6c785be9d1b (diff) | |
parent | 0706fd366faab8274d96662265ac8c14baf0762c (diff) | |
download | barebox-f13f1c269ebffca25697deb420cce64b099d66b5.tar.gz barebox-f13f1c269ebffca25697deb420cce64b099d66b5.tar.xz |
Merge branch 'pu/am335x'
Diffstat (limited to 'drivers/usb/musb')
-rw-r--r-- | drivers/usb/musb/musb_barebox.c | 1 | ||||
-rw-r--r-- | drivers/usb/musb/musb_dsps.c | 21 |
2 files changed, 10 insertions, 12 deletions
diff --git a/drivers/usb/musb/musb_barebox.c b/drivers/usb/musb/musb_barebox.c index 6bc232b570..b1f38c35ac 100644 --- a/drivers/usb/musb/musb_barebox.c +++ b/drivers/usb/musb/musb_barebox.c @@ -139,6 +139,7 @@ int musb_register(struct musb *musb) host->submit_control_msg = submit_control_msg; host->submit_bulk_msg = submit_bulk_msg; + musb->controller->priv = musb; musb->controller->detect = musb_detect; usb_register_host(host); diff --git a/drivers/usb/musb/musb_dsps.c b/drivers/usb/musb/musb_dsps.c index bf676a19c6..958aeec685 100644 --- a/drivers/usb/musb/musb_dsps.c +++ b/drivers/usb/musb/musb_dsps.c @@ -129,14 +129,17 @@ struct dsps_glue { struct musb_hdrc_platform_data pdata; }; +static struct dsps_glue *to_dsps_glue(struct musb *musb) +{ + return container_of(musb, struct dsps_glue, musb); +} + /** * dsps_musb_enable - enable interrupts */ static void dsps_musb_enable(struct musb *musb) { - struct device_d *dev = musb->controller; - struct device_d *pdev = dev; - struct dsps_glue *glue = pdev->priv; + struct dsps_glue *glue = to_dsps_glue(musb); const struct dsps_musb_wrapper *wrp = glue->wrp; void __iomem *reg_base = musb->ctrl_base; u32 epmask, coremask; @@ -158,9 +161,7 @@ static void dsps_musb_enable(struct musb *musb) */ static void dsps_musb_disable(struct musb *musb) { - struct device_d *dev = musb->controller; - struct device_d *pdev = dev; - struct dsps_glue *glue = pdev->priv; + struct dsps_glue *glue = to_dsps_glue(musb); const struct dsps_musb_wrapper *wrp = glue->wrp; void __iomem *reg_base = musb->ctrl_base; @@ -173,8 +174,7 @@ static void dsps_musb_disable(struct musb *musb) static irqreturn_t dsps_interrupt(struct musb *musb) { void __iomem *reg_base = musb->ctrl_base; - struct device_d *dev = musb->controller; - struct dsps_glue *glue = dev->priv; + struct dsps_glue *glue = to_dsps_glue(musb); const struct dsps_musb_wrapper *wrp = glue->wrp; unsigned long flags; irqreturn_t ret = IRQ_NONE; @@ -213,8 +213,7 @@ out: static int dsps_musb_init(struct musb *musb) { - struct device_d *dev = musb->controller; - struct dsps_glue *glue = dev->priv; + struct dsps_glue *glue = to_dsps_glue(musb); const struct dsps_musb_wrapper *wrp = glue->wrp; u32 rev, val, mode; @@ -377,8 +376,6 @@ static int dsps_probe(struct device_d *dev) glue->dev = dev; glue->wrp = wrp; - dev->priv = glue; - pdata = &glue->pdata; glue->musb.mregs = dev_request_mem_region(dev, 0); |