[PATCH] pwm: cros-ec: fix transposed param settings

2017-06-23 Thread Nick Vaccaro
The __cros_ec_pwm_get_duty() routine was transposing the insize and
outsize fields when calling cros_ec_cmd_xfer_status().

The original code worked without error due to size of the two particular
parameter blocks passed to cros_ec_cmd_xfer_status(), so this change is
not fixing an actual runtime problem, just correcting the calling usage.

Signed-off-by: Nick Vaccaro <nvacc...@chromium.org>
Reviewed-by: Brian Norris <briannor...@chromium.org>
---
 drivers/pwm/pwm-cros-ec.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/pwm/pwm-cros-ec.c b/drivers/pwm/pwm-cros-ec.c
index 2e4ab20cfb83..de5b7c9860b6 100644
--- a/drivers/pwm/pwm-cros-ec.c
+++ b/drivers/pwm/pwm-cros-ec.c
@@ -75,8 +75,8 @@ static int __cros_ec_pwm_get_duty(struct cros_ec_device *ec, 
u8 index,
 
msg->version = 0;
msg->command = EC_CMD_PWM_GET_DUTY;
-   msg->insize = sizeof(*params);
-   msg->outsize = sizeof(*resp);
+   msg->insize = sizeof(*resp);
+   msg->outsize = sizeof(*params);
 
params->pwm_type = EC_PWM_TYPE_GENERIC;
params->index = index;
-- 
2.13.1.518.g3df882009-goog



[PATCH] pwm: cros-ec: fix transposed param settings

2017-06-23 Thread Nick Vaccaro
The __cros_ec_pwm_get_duty() routine was transposing the insize and
outsize fields when calling cros_ec_cmd_xfer_status().

The original code worked without error due to size of the two particular
parameter blocks passed to cros_ec_cmd_xfer_status(), so this change is
not fixing an actual runtime problem, just correcting the calling usage.

Signed-off-by: Nick Vaccaro 
Reviewed-by: Brian Norris 
---
 drivers/pwm/pwm-cros-ec.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/pwm/pwm-cros-ec.c b/drivers/pwm/pwm-cros-ec.c
index 2e4ab20cfb83..de5b7c9860b6 100644
--- a/drivers/pwm/pwm-cros-ec.c
+++ b/drivers/pwm/pwm-cros-ec.c
@@ -75,8 +75,8 @@ static int __cros_ec_pwm_get_duty(struct cros_ec_device *ec, 
u8 index,
 
msg->version = 0;
msg->command = EC_CMD_PWM_GET_DUTY;
-   msg->insize = sizeof(*params);
-   msg->outsize = sizeof(*resp);
+   msg->insize = sizeof(*resp);
+   msg->outsize = sizeof(*params);
 
params->pwm_type = EC_PWM_TYPE_GENERIC;
params->index = index;
-- 
2.13.1.518.g3df882009-goog



[PATCH] FIXUP: CHROMIUM: fix transposed param settings

2017-06-22 Thread Nick Vaccaro
The __cros_ec_pwm_get_duty() routine was transposing the insize and
outsize fields when calling cros_ec_cmd_xfer_status().

The original code worked without error due to size of the two particular
parameter blocks passed to cros_ec_cmd_xfer_status(), so this change is
not fixing an actual runtime problem, just correcting the calling usage.

Signed-off-by: Nick Vaccaro <nvacc...@chromium.org>
---
 drivers/pwm/pwm-cros-ec.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/pwm/pwm-cros-ec.c b/drivers/pwm/pwm-cros-ec.c
index 2e4ab20cfb83..de5b7c9860b6 100644
--- a/drivers/pwm/pwm-cros-ec.c
+++ b/drivers/pwm/pwm-cros-ec.c
@@ -75,8 +75,8 @@ static int __cros_ec_pwm_get_duty(struct cros_ec_device *ec, 
u8 index,
 
msg->version = 0;
msg->command = EC_CMD_PWM_GET_DUTY;
-   msg->insize = sizeof(*params);
-   msg->outsize = sizeof(*resp);
+   msg->insize = sizeof(*resp);
+   msg->outsize = sizeof(*params);
 
params->pwm_type = EC_PWM_TYPE_GENERIC;
params->index = index;
-- 
2.12.2



[PATCH] FIXUP: CHROMIUM: fix transposed param settings

2017-06-22 Thread Nick Vaccaro
The __cros_ec_pwm_get_duty() routine was transposing the insize and
outsize fields when calling cros_ec_cmd_xfer_status().

The original code worked without error due to size of the two particular
parameter blocks passed to cros_ec_cmd_xfer_status(), so this change is
not fixing an actual runtime problem, just correcting the calling usage.

Signed-off-by: Nick Vaccaro 
---
 drivers/pwm/pwm-cros-ec.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/pwm/pwm-cros-ec.c b/drivers/pwm/pwm-cros-ec.c
index 2e4ab20cfb83..de5b7c9860b6 100644
--- a/drivers/pwm/pwm-cros-ec.c
+++ b/drivers/pwm/pwm-cros-ec.c
@@ -75,8 +75,8 @@ static int __cros_ec_pwm_get_duty(struct cros_ec_device *ec, 
u8 index,
 
msg->version = 0;
msg->command = EC_CMD_PWM_GET_DUTY;
-   msg->insize = sizeof(*params);
-   msg->outsize = sizeof(*resp);
+   msg->insize = sizeof(*resp);
+   msg->outsize = sizeof(*params);
 
params->pwm_type = EC_PWM_TYPE_GENERIC;
params->index = index;
-- 
2.12.2