Commit e2e02ca4 authored by Devin Heitmueller's avatar Devin Heitmueller Committed by Mauro Carvalho Chehab

[media] staging: as102: Fix CodingStyle errors in file as10x_cmd_cfg.c

Fix Linux kernel coding style (whitespace and indentation) errors
in file as10x_cmd_cfg.c. No functional changes.
Signed-off-by: default avatarDevin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: default avatarPiotr Chmura <chmooreck@poczta.onet.pl>
Signed-off-by: default avatarSylwester Nawrocki <snjw23@gmail.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent c7a6c001
...@@ -2,8 +2,6 @@ ...@@ -2,8 +2,6 @@
\file as10x_cmd_cfg.c \file as10x_cmd_cfg.c
\version $Id$
\author: S. Martinelli \author: S. Martinelli
----------------------------------------------------------------------------\n ----------------------------------------------------------------------------\n
...@@ -22,7 +20,8 @@ ...@@ -22,7 +20,8 @@
#include <linux/kernel.h> #include <linux/kernel.h>
#include "as102_drv.h" #include "as102_drv.h"
#elif defined(WIN32) #elif defined(WIN32)
#if defined(__BUILDMACHINE__) && (__BUILDMACHINE__ == WinDDK) /* win32 ddk implementation */ #if defined(__BUILDMACHINE__) && (__BUILDMACHINE__ == WinDDK)
/* win32 ddk implementation */
#include "wdm.h" #include "wdm.h"
#include "Device.h" #include "Device.h"
#include "endian_mgmt.h" /* FIXME */ #include "endian_mgmt.h" /* FIXME */
...@@ -59,52 +58,52 @@ ...@@ -59,52 +58,52 @@
int as10x_cmd_get_context(as10x_handle_t *phandle, uint16_t tag, int as10x_cmd_get_context(as10x_handle_t *phandle, uint16_t tag,
uint32_t *pvalue) uint32_t *pvalue)
{ {
int error; int error;
struct as10x_cmd_t *pcmd, *prsp; struct as10x_cmd_t *pcmd, *prsp;
ENTER(); ENTER();
pcmd = phandle->cmd; pcmd = phandle->cmd;
prsp = phandle->rsp; prsp = phandle->rsp;
/* prepare command */ /* prepare command */
as10x_cmd_build(pcmd, (++phandle->cmd_xid), as10x_cmd_build(pcmd, (++phandle->cmd_xid),
sizeof(pcmd->body.context.req)); sizeof(pcmd->body.context.req));
/* fill command */ /* fill command */
pcmd->body.context.req.proc_id = cpu_to_le16(CONTROL_PROC_CONTEXT); pcmd->body.context.req.proc_id = cpu_to_le16(CONTROL_PROC_CONTEXT);
pcmd->body.context.req.tag = cpu_to_le16(tag); pcmd->body.context.req.tag = cpu_to_le16(tag);
pcmd->body.context.req.type = cpu_to_le16(GET_CONTEXT_DATA); pcmd->body.context.req.type = cpu_to_le16(GET_CONTEXT_DATA);
/* send command */ /* send command */
if(phandle->ops->xfer_cmd) { if (phandle->ops->xfer_cmd) {
error = phandle->ops->xfer_cmd(phandle, error = phandle->ops->xfer_cmd(phandle,
(uint8_t *) pcmd, (uint8_t *) pcmd,
sizeof(pcmd->body.context.req) + HEADER_SIZE, sizeof(pcmd->body.context.req)
(uint8_t *) prsp, + HEADER_SIZE,
sizeof(prsp->body.context.rsp) + HEADER_SIZE); (uint8_t *) prsp,
} sizeof(prsp->body.context.rsp)
else{ + HEADER_SIZE);
error = AS10X_CMD_ERROR; } else {
} error = AS10X_CMD_ERROR;
}
if(error < 0) {
goto out; if (error < 0)
} goto out;
/* parse response: context command do not follow the common response */ /* parse response: context command do not follow the common response */
/* structure -> specific handling response parse required */ /* structure -> specific handling response parse required */
error = as10x_context_rsp_parse(prsp, CONTROL_PROC_CONTEXT_RSP); error = as10x_context_rsp_parse(prsp, CONTROL_PROC_CONTEXT_RSP);
if(error == 0) { if (error == 0) {
/* Response OK -> get response data */ /* Response OK -> get response data */
*pvalue = le32_to_cpu(prsp->body.context.rsp.reg_val.u.value32); *pvalue = le32_to_cpu(prsp->body.context.rsp.reg_val.u.value32);
/* value returned is always a 32-bit value */ /* value returned is always a 32-bit value */
} }
out: out:
LEAVE(); LEAVE();
return(error); return error;
} }
/** /**
...@@ -118,47 +117,48 @@ int as10x_cmd_get_context(as10x_handle_t *phandle, uint16_t tag, ...@@ -118,47 +117,48 @@ int as10x_cmd_get_context(as10x_handle_t *phandle, uint16_t tag,
int as10x_cmd_set_context(as10x_handle_t *phandle, uint16_t tag, int as10x_cmd_set_context(as10x_handle_t *phandle, uint16_t tag,
uint32_t value) uint32_t value)
{ {
int error; int error;
struct as10x_cmd_t *pcmd, *prsp; struct as10x_cmd_t *pcmd, *prsp;
ENTER(); ENTER();
pcmd = phandle->cmd; pcmd = phandle->cmd;
prsp = phandle->rsp; prsp = phandle->rsp;
/* prepare command */ /* prepare command */
as10x_cmd_build(pcmd,(++phandle->cmd_xid),sizeof(pcmd->body.context.req)); as10x_cmd_build(pcmd, (++phandle->cmd_xid),
sizeof(pcmd->body.context.req));
/* fill command */
pcmd->body.context.req.proc_id = cpu_to_le16(CONTROL_PROC_CONTEXT); /* fill command */
/* pcmd->body.context.req.reg_val.mode initialization is not required */ pcmd->body.context.req.proc_id = cpu_to_le16(CONTROL_PROC_CONTEXT);
pcmd->body.context.req.reg_val.u.value32 = cpu_to_le32(value); /* pcmd->body.context.req.reg_val.mode initialization is not required */
pcmd->body.context.req.tag = cpu_to_le16(tag); pcmd->body.context.req.reg_val.u.value32 = cpu_to_le32(value);
pcmd->body.context.req.type = cpu_to_le16(SET_CONTEXT_DATA); pcmd->body.context.req.tag = cpu_to_le16(tag);
pcmd->body.context.req.type = cpu_to_le16(SET_CONTEXT_DATA);
/* send command */
if(phandle->ops->xfer_cmd){ /* send command */
error = phandle->ops->xfer_cmd(phandle, if (phandle->ops->xfer_cmd) {
(uint8_t *) pcmd, error = phandle->ops->xfer_cmd(phandle,
sizeof(pcmd->body.context.req) + HEADER_SIZE, (uint8_t *) pcmd,
(uint8_t *) prsp, sizeof(pcmd->body.context.req)
sizeof(prsp->body.context.rsp) + HEADER_SIZE); + HEADER_SIZE,
} (uint8_t *) prsp,
else{ sizeof(prsp->body.context.rsp)
error = AS10X_CMD_ERROR; + HEADER_SIZE);
} } else {
error = AS10X_CMD_ERROR;
if(error < 0) { }
goto out;
} if (error < 0)
goto out;
/* parse response: context command do not follow the common response */
/* structure -> specific handling response parse required */ /* parse response: context command do not follow the common response */
error = as10x_context_rsp_parse(prsp, CONTROL_PROC_CONTEXT_RSP); /* structure -> specific handling response parse required */
error = as10x_context_rsp_parse(prsp, CONTROL_PROC_CONTEXT_RSP);
out: out:
LEAVE(); LEAVE();
return(error); return error;
} }
/** /**
...@@ -175,45 +175,43 @@ int as10x_cmd_set_context(as10x_handle_t *phandle, uint16_t tag, ...@@ -175,45 +175,43 @@ int as10x_cmd_set_context(as10x_handle_t *phandle, uint16_t tag,
*/ */
int as10x_cmd_eLNA_change_mode(as10x_handle_t *phandle, uint8_t mode) int as10x_cmd_eLNA_change_mode(as10x_handle_t *phandle, uint8_t mode)
{ {
int error; int error;
struct as10x_cmd_t *pcmd, *prsp; struct as10x_cmd_t *pcmd, *prsp;
ENTER(); ENTER();
pcmd = phandle->cmd; pcmd = phandle->cmd;
prsp = phandle->rsp; prsp = phandle->rsp;
/* prepare command */ /* prepare command */
as10x_cmd_build(pcmd, (++phandle->cmd_xid), as10x_cmd_build(pcmd, (++phandle->cmd_xid),
sizeof(pcmd->body.cfg_change_mode.req)); sizeof(pcmd->body.cfg_change_mode.req));
/* fill command */ /* fill command */
pcmd->body.cfg_change_mode.req.proc_id = pcmd->body.cfg_change_mode.req.proc_id =
cpu_to_le16(CONTROL_PROC_ELNA_CHANGE_MODE); cpu_to_le16(CONTROL_PROC_ELNA_CHANGE_MODE);
pcmd->body.cfg_change_mode.req.mode = mode; pcmd->body.cfg_change_mode.req.mode = mode;
/* send command */ /* send command */
if(phandle->ops->xfer_cmd){ if (phandle->ops->xfer_cmd) {
error = phandle->ops->xfer_cmd(phandle, error = phandle->ops->xfer_cmd(phandle, (uint8_t *) pcmd,
(uint8_t *) pcmd, sizeof(pcmd->body.cfg_change_mode.req)
sizeof(pcmd->body.cfg_change_mode.req) + HEADER_SIZE, + HEADER_SIZE, (uint8_t *) prsp,
(uint8_t *) prsp, sizeof(prsp->body.cfg_change_mode.rsp)
sizeof(prsp->body.cfg_change_mode.rsp) + HEADER_SIZE); + HEADER_SIZE);
} } else {
else{ error = AS10X_CMD_ERROR;
error = AS10X_CMD_ERROR; }
}
if (error < 0)
if(error < 0) { goto out;
goto out;
} /* parse response */
error = as10x_rsp_parse(prsp, CONTROL_PROC_ELNA_CHANGE_MODE_RSP);
/* parse response */
error = as10x_rsp_parse(prsp, CONTROL_PROC_ELNA_CHANGE_MODE_RSP);
out: out:
LEAVE(); LEAVE();
return(error); return error;
} }
/** /**
...@@ -225,15 +223,15 @@ int as10x_cmd_eLNA_change_mode(as10x_handle_t *phandle, uint8_t mode) ...@@ -225,15 +223,15 @@ int as10x_cmd_eLNA_change_mode(as10x_handle_t *phandle, uint8_t mode)
ABILIS_RC_NOK ABILIS_RC_NOK
\callgraph \callgraph
*/ */
int as10x_context_rsp_parse(struct as10x_cmd_t *prsp, uint16_t proc_id) { int as10x_context_rsp_parse(struct as10x_cmd_t *prsp, uint16_t proc_id)
{
int err; int err;
err = prsp->body.context.rsp.error; err = prsp->body.context.rsp.error;
if((err == 0) && if ((err == 0) &&
(le16_to_cpu(prsp->body.context.rsp.proc_id) == proc_id)) { (le16_to_cpu(prsp->body.context.rsp.proc_id) == proc_id)) {
return 0; return 0;
} }
return AS10X_CMD_ERROR; return AS10X_CMD_ERROR;
} }
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