USB: host: SL811: fix unaligned accesses
Signed-off-by: Michael Hennerich <michael.hennerich@analog.com> Signed-off-by: Bryan Wu <cooloney@kernel.org> Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
parent
6ebb7d1b4b
commit
8ca5bfab15
@ -51,6 +51,7 @@
|
|||||||
#include <asm/irq.h>
|
#include <asm/irq.h>
|
||||||
#include <asm/system.h>
|
#include <asm/system.h>
|
||||||
#include <asm/byteorder.h>
|
#include <asm/byteorder.h>
|
||||||
|
#include <asm/unaligned.h>
|
||||||
|
|
||||||
#include "../core/hcd.h"
|
#include "../core/hcd.h"
|
||||||
#include "sl811.h"
|
#include "sl811.h"
|
||||||
@ -1272,12 +1273,12 @@ sl811h_hub_control(
|
|||||||
sl811h_hub_descriptor(sl811, (struct usb_hub_descriptor *) buf);
|
sl811h_hub_descriptor(sl811, (struct usb_hub_descriptor *) buf);
|
||||||
break;
|
break;
|
||||||
case GetHubStatus:
|
case GetHubStatus:
|
||||||
*(__le32 *) buf = cpu_to_le32(0);
|
put_unaligned_le32(0, buf);
|
||||||
break;
|
break;
|
||||||
case GetPortStatus:
|
case GetPortStatus:
|
||||||
if (wIndex != 1)
|
if (wIndex != 1)
|
||||||
goto error;
|
goto error;
|
||||||
*(__le32 *) buf = cpu_to_le32(sl811->port1);
|
put_unaligned_le32(sl811->port1, buf);
|
||||||
|
|
||||||
#ifndef VERBOSE
|
#ifndef VERBOSE
|
||||||
if (*(u16*)(buf+2)) /* only if wPortChange is interesting */
|
if (*(u16*)(buf+2)) /* only if wPortChange is interesting */
|
||||||
|
Loading…
Reference in New Issue
Block a user