summaryrefslogtreecommitdiffstats
path: root/drivers/usb/musb
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2015-04-28 11:43:04 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2015-04-28 11:43:06 +0200
commit15e121ada53deb46da99d76f0417c728be436099 (patch)
tree69c6478963a486faa4d1d2f5e1764716b270621c /drivers/usb/musb
parent10e69303239b91a81149490fd22c848a0813c35e (diff)
downloadbarebox-15e121ada53deb46da99d76f0417c728be436099.tar.gz
barebox-15e121ada53deb46da99d76f0417c728be436099.tar.xz
usb: musb: dsps: Do not use priv pointer
Use container_of instead of dev->priv pointer. dev->priv is used by the musb core layer (which maybe should not be the case, but using container_of is good anyway). Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers/usb/musb')
-rw-r--r--drivers/usb/musb/musb_dsps.c21
1 files changed, 9 insertions, 12 deletions
diff --git a/drivers/usb/musb/musb_dsps.c b/drivers/usb/musb/musb_dsps.c
index 36a316ab37..7bad1f813e 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);