diff options
author | Jens Frederich <jfrederich@gmail.com> | 2013-08-15 19:40:01 (GMT) |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-08-16 00:23:16 (GMT) |
commit | 24b7ed475e2b71eba68ee9714b29c712f8dc41f6 (patch) | |
tree | 13abd68d14384657641bb00d04769305a0efaf72 /drivers/staging | |
parent | 98d4f93c79b002f85480320fe63fefaa31d58b6c (diff) | |
download | linux-fsl-qoriq-24b7ed475e2b71eba68ee9714b29c712f8dc41f6.tar.xz |
Staging: olpc_dcon: more big endian conformity
Using an int which is casted to unsigned char as inbuf is messy.
The code won't work on big endian systems. The patch should fix
this.
Signed-off-by: Jens Frederich <jfrederich@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging')
-rw-r--r-- | drivers/staging/olpc_dcon/olpc_dcon.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/drivers/staging/olpc_dcon/olpc_dcon.c b/drivers/staging/olpc_dcon/olpc_dcon.c index 5ca4fa4..198595e 100644 --- a/drivers/staging/olpc_dcon/olpc_dcon.c +++ b/drivers/staging/olpc_dcon/olpc_dcon.c @@ -122,12 +122,13 @@ err: static int dcon_bus_stabilize(struct dcon_priv *dcon, int is_powered_down) { unsigned long timeout; + u8 pm; int x; power_up: if (is_powered_down) { - x = 1; - x = olpc_ec_cmd(EC_DCON_POWER_MODE, (u8 *)&x, 1, NULL, 0); + pm = 1; + x = olpc_ec_cmd(EC_DCON_POWER_MODE, &pm, 1, NULL, 0); if (x) { pr_warn("unable to force dcon to power up: %d!\n", x); return x; @@ -144,8 +145,8 @@ power_up: if (x < 0) { pr_err("unable to stabilize dcon's smbus, reasserting power and praying.\n"); BUG_ON(olpc_board_at_least(olpc_board(0xc2))); - x = 0; - olpc_ec_cmd(EC_DCON_POWER_MODE, (u8 *)&x, 1, NULL, 0); + pm = 0; + olpc_ec_cmd(EC_DCON_POWER_MODE, &pm, 1, NULL, 0); msleep(100); is_powered_down = 1; goto power_up; /* argh, stupid hardware.. */ @@ -208,8 +209,8 @@ static void dcon_sleep(struct dcon_priv *dcon, bool sleep) return; if (sleep) { - x = 0; - x = olpc_ec_cmd(EC_DCON_POWER_MODE, (u8 *)&x, 1, NULL, 0); + u8 pm = 0; + x = olpc_ec_cmd(EC_DCON_POWER_MODE, &pm, 1, NULL, 0); if (x) pr_warn("unable to force dcon to power down: %d!\n", x); else |