Commit c586fc57 authored by Luca Ellero's avatar Luca Ellero Committed by Greg Kroah-Hartman

staging: ced1401: fix ced_get_state()

Rename camel case arguments and locals in function ced_get_state()
Signed-off-by: default avatarLuca Ellero <luca.ellero@brickedbrain.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 531c79cc
...@@ -176,37 +176,41 @@ int ced_send_char(struct ced_data *ced, char c) ...@@ -176,37 +176,41 @@ int ced_send_char(struct ced_data *ced, char c)
*/ */
int ced_get_state(struct ced_data *ced, __u32 *state, __u32 *error) int ced_get_state(struct ced_data *ced, __u32 *state, __u32 *error)
{ {
int nGot; int got;
dev_dbg(&ced->interface->dev, "%s: entry\n", __func__); dev_dbg(&ced->interface->dev, "%s: entry\n", __func__);
*state = 0xFFFFFFFF; /* Start off with invalid state */ *state = 0xFFFFFFFF; /* Start off with invalid state */
nGot = usb_control_msg(ced->udev, usb_rcvctrlpipe(ced->udev, 0), got = usb_control_msg(ced->udev, usb_rcvctrlpipe(ced->udev, 0),
GET_STATUS, (D_TO_H | VENDOR | DEVREQ), 0, 0, GET_STATUS, (D_TO_H | VENDOR | DEVREQ), 0, 0,
ced->stat_buf, sizeof(ced->stat_buf), HZ); ced->stat_buf, sizeof(ced->stat_buf), HZ);
if (nGot != sizeof(ced->stat_buf)) { if (got != sizeof(ced->stat_buf)) {
dev_err(&ced->interface->dev, dev_err(&ced->interface->dev,
"%s: FAILED, return code %d\n", __func__, nGot); "%s: FAILED, return code %d\n", __func__, got);
ced->current_state = U14ERR_TIME; /* Indicate that things are very wrong indeed */ /* Indicate that things are very wrong indeed */
ced->current_state = U14ERR_TIME;
*state = 0; /* Force status values to a known state */ *state = 0; /* Force status values to a known state */
*error = 0; *error = 0;
} else { } else {
int nDevice; int device;
dev_dbg(&ced->interface->dev, dev_dbg(&ced->interface->dev,
"%s: Success, state: 0x%x, 0x%x\n", "%s: Success, state: 0x%x, 0x%x\n",
__func__, ced->stat_buf[0], ced->stat_buf[1]); __func__, ced->stat_buf[0], ced->stat_buf[1]);
*state = ced->stat_buf[0]; /* Return the state values to the calling code */ /* Return the state values to the calling code */
*state = ced->stat_buf[0];
*error = ced->stat_buf[1]; *error = ced->stat_buf[1];
nDevice = ced->udev->descriptor.bcdDevice >> 8; /* 1401 type code value */ /* 1401 type code value */
switch (nDevice) { /* so we can clean up current state */ device = ced->udev->descriptor.bcdDevice >> 8;
switch (device) { /* so we can clean up current state */
case 0: case 0:
ced->current_state = U14ERR_U1401; ced->current_state = U14ERR_U1401;
break; break;
default: /* allow lots of device codes for future 1401s */ default: /* allow lots of device codes for future 1401s */
if ((nDevice >= 1) && (nDevice <= 23)) if ((device >= 1) && (device <= 23))
ced->current_state = (short)(nDevice + 6); ced->current_state = (short)(device + 6);
else else
ced->current_state = U14ERR_ILL; ced->current_state = U14ERR_ILL;
break; break;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment