From: Alex Elder Date: Tue, 2 Dec 2014 21:48:09 +0000 (-0600) Subject: greybus: use little-endian in PWM requests X-Git-Tag: v4.9-rc1~119^2~378^2~21^2~1790 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=583d233fa9d6fffd028af5219bcb5753bcb7b5ef;p=karo-tx-linux.git greybus: use little-endian in PWM requests The PWM config request defines two 32-bit values using u32. All over-the-wire values have to be in little-endian format. Fix this. Signed-off-by: Alex Elder Acked-by: Matt Porter Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/greybus/pwm-gb.c b/drivers/staging/greybus/pwm-gb.c index bd1379f4400f..9678b6431760 100644 --- a/drivers/staging/greybus/pwm-gb.c +++ b/drivers/staging/greybus/pwm-gb.c @@ -62,8 +62,8 @@ struct gb_pwm_deactivate_request { struct gb_pwm_config_request { __u8 which; - __u32 duty; - __u32 period; + __le32 duty; + __le32 period; }; struct gb_pwm_polarity_request { @@ -152,8 +152,8 @@ static int gb_pwm_config_operation(struct gb_pwm_chip *pwmc, return -EINVAL; request.which = which; - request.duty = duty; - request.period = period; + request.duty = cpu_to_le32(duty); + request.period = cpu_to_le32(period); return gb_operation_sync(pwmc->connection, GB_PWM_TYPE_CONFIG, &request, sizeof(request), NULL, 0); }