summaryrefslogtreecommitdiffstats
path: root/drivers/usb/otg/mv_otg.c
diff options
context:
space:
mode:
authorCesar Eduardo Barros2012-12-04 23:21:12 +0100
committerFelipe Balbi2013-01-18 14:08:42 +0100
commit63a1307930867a45f86a1a69f80315b2df7b7b49 (patch)
tree7cc885a16b207361b91c3032a7d5aeeb943c5944 /drivers/usb/otg/mv_otg.c
parentusb: phy: s3c-hsotg: adding phy driver support (diff)
downloadkernel-qcow2-linux-63a1307930867a45f86a1a69f80315b2df7b7b49.tar.gz
kernel-qcow2-linux-63a1307930867a45f86a1a69f80315b2df7b7b49.tar.xz
kernel-qcow2-linux-63a1307930867a45f86a1a69f80315b2df7b7b49.zip
usb: phy: mv-otg: use to_delayed_work instead of cast
Directly casting a work_struct pointer to a delayed_work is risky if the work member of struct delayed_work is ever moved from being the first member. Instead, use the inline function to_delayed_work(), which does the same cast in a safer way (using container_of). Signed-off-by: Cesar Eduardo Barros <cesarb@cesarb.net> Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/otg/mv_otg.c')
-rw-r--r--drivers/usb/otg/mv_otg.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/usb/otg/mv_otg.c b/drivers/usb/otg/mv_otg.c
index 1dd57504186d..5104bc2b67b3 100644
--- a/drivers/usb/otg/mv_otg.c
+++ b/drivers/usb/otg/mv_otg.c
@@ -420,7 +420,7 @@ static void mv_otg_work(struct work_struct *work)
struct usb_otg *otg;
int old_state;
- mvotg = container_of((struct delayed_work *)work, struct mv_otg, work);
+ mvotg = container_of(to_delayed_work(work), struct mv_otg, work);
run:
/* work queue is single thread, or we need spin_lock to protect */