From 8418366d11195e6f12d3a1767dbb2f0191ca8989 Mon Sep 17 00:00:00 2001 From: Martin Blumenstingl Date: Thu, 4 Oct 2012 14:22:55 -0300 Subject: [media] drxk: Use the #define instead of hardcoded values Signed-off-by: Martin Blumenstingl Signed-off-by: Mauro Carvalho Chehab --- drivers/media/dvb-frontends/drxk_hard.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers/media/dvb-frontends/drxk_hard.c') diff --git a/drivers/media/dvb-frontends/drxk_hard.c b/drivers/media/dvb-frontends/drxk_hard.c index 8b4c6d5f8f36..894b6eca5b26 100644 --- a/drivers/media/dvb-frontends/drxk_hard.c +++ b/drivers/media/dvb-frontends/drxk_hard.c @@ -921,7 +921,7 @@ static int GetDeviceCapabilities(struct drxk_state *state) status = write16(state, SCU_RAM_GPIO__A, SCU_RAM_GPIO_HW_LOCK_IND_DISABLE); if (status < 0) goto error; - status = write16(state, SIO_TOP_COMM_KEY__A, 0xFABA); + status = write16(state, SIO_TOP_COMM_KEY__A, SIO_TOP_COMM_KEY_KEY); if (status < 0) goto error; status = read16(state, SIO_PDR_OHW_CFG__A, &sioPdrOhwCfg); @@ -1217,7 +1217,7 @@ static int MPEGTSConfigurePins(struct drxk_state *state, bool mpegEnable) goto error; /* MPEG TS pad configuration */ - status = write16(state, SIO_TOP_COMM_KEY__A, 0xFABA); + status = write16(state, SIO_TOP_COMM_KEY__A, SIO_TOP_COMM_KEY_KEY); if (status < 0) goto error; -- cgit v1.2.3 From ff38c21663c5f9b8d33cf2979e07e811f2560161 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Thu, 25 Oct 2012 13:40:04 -0200 Subject: [media] drxk_hard: fix a few warnings drivers/media/dvb-frontends/drxk_hard.c:68:6: warning: no previous prototype for 'IsA1WithPatchCode' [-Wmissing-prototypes] drivers/media/dvb-frontends/drxk_hard.c:73:6: warning: no previous prototype for 'IsA1WithRomCode' [-Wmissing-prototypes] drivers/media/dvb-frontends/drxk_hard.c:192:12: warning: no previous prototype for 'Frac28a' [-Wmissing-prototypes] drivers/media/dvb-frontends/drxk_hard.c:590:5: warning: no previous prototype for 'PowerUpDevice' [-Wmissing-prototypes] Signed-off-by: Mauro Carvalho Chehab --- drivers/media/dvb-frontends/drxk_hard.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'drivers/media/dvb-frontends/drxk_hard.c') diff --git a/drivers/media/dvb-frontends/drxk_hard.c b/drivers/media/dvb-frontends/drxk_hard.c index 894b6eca5b26..fb23496cd65d 100644 --- a/drivers/media/dvb-frontends/drxk_hard.c +++ b/drivers/media/dvb-frontends/drxk_hard.c @@ -65,12 +65,12 @@ static bool IsQAM(struct drxk_state *state) state->m_OperationMode == OM_QAM_ITU_C; } -bool IsA1WithPatchCode(struct drxk_state *state) +static bool IsA1WithPatchCode(struct drxk_state *state) { return state->m_DRXK_A1_PATCH_CODE; } -bool IsA1WithRomCode(struct drxk_state *state) +static bool IsA1WithRomCode(struct drxk_state *state) { return state->m_DRXK_A1_ROM_CODE; } @@ -189,7 +189,7 @@ static inline u32 MulDiv32(u32 a, u32 b, u32 c) return (u32) tmp64; } -inline u32 Frac28a(u32 a, u32 c) +static inline u32 Frac28a(u32 a, u32 c) { int i = 0; u32 Q1 = 0; @@ -587,7 +587,7 @@ static int write_block(struct drxk_state *state, u32 Address, #define DRXK_MAX_RETRIES_POWERUP 20 #endif -int PowerUpDevice(struct drxk_state *state) +static int PowerUpDevice(struct drxk_state *state) { int status; u8 data = 0; -- cgit v1.2.3 From 5a70972e142b182fb9375b9060a4dd9fad47fadf Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Sat, 27 Oct 2012 16:12:00 -0300 Subject: [media] drxk: get rid of some unused vars drivers/media/dvb-frontends/drxk_hard.c:68:13: warning: 'IsA1WithPatchCode' defined but not used [-Wunused-function] drivers/media/dvb-frontends/drxk_hard.c:73:13: warning: 'IsA1WithRomCode' defined but not used [-Wunused-function] Signed-off-by: Mauro Carvalho Chehab --- drivers/media/dvb-frontends/drxk_hard.c | 15 --------------- drivers/media/dvb-frontends/drxk_hard.h | 6 +----- 2 files changed, 1 insertion(+), 20 deletions(-) (limited to 'drivers/media/dvb-frontends/drxk_hard.c') diff --git a/drivers/media/dvb-frontends/drxk_hard.c b/drivers/media/dvb-frontends/drxk_hard.c index fb23496cd65d..59382fbb3286 100644 --- a/drivers/media/dvb-frontends/drxk_hard.c +++ b/drivers/media/dvb-frontends/drxk_hard.c @@ -65,16 +65,6 @@ static bool IsQAM(struct drxk_state *state) state->m_OperationMode == OM_QAM_ITU_C; } -static bool IsA1WithPatchCode(struct drxk_state *state) -{ - return state->m_DRXK_A1_PATCH_CODE; -} - -static bool IsA1WithRomCode(struct drxk_state *state) -{ - return state->m_DRXK_A1_ROM_CODE; -} - #define NOA1ROM 0 #define DRXDAP_FASI_SHORT_FORMAT(addr) (((addr) & 0xFC30FF80) == 0) @@ -720,11 +710,6 @@ static int init_state(struct drxk_state *state) state->m_bPowerDown = (ulPowerDown != 0); - state->m_DRXK_A1_PATCH_CODE = false; - state->m_DRXK_A1_ROM_CODE = false; - state->m_DRXK_A2_ROM_CODE = false; - state->m_DRXK_A3_ROM_CODE = false; - state->m_DRXK_A2_PATCH_CODE = false; state->m_DRXK_A3_PATCH_CODE = false; /* Init AGC and PGA parameters */ diff --git a/drivers/media/dvb-frontends/drxk_hard.h b/drivers/media/dvb-frontends/drxk_hard.h index 6bb9fc4a7b96..d18a896a9835 100644 --- a/drivers/media/dvb-frontends/drxk_hard.h +++ b/drivers/media/dvb-frontends/drxk_hard.h @@ -320,11 +320,7 @@ struct drxk_state { u8 *m_microcode; int m_microcode_length; - bool m_DRXK_A1_PATCH_CODE; - bool m_DRXK_A1_ROM_CODE; - bool m_DRXK_A2_ROM_CODE; - bool m_DRXK_A3_ROM_CODE; - bool m_DRXK_A2_PATCH_CODE; + bool m_DRXK_A3_ROM_CODE; bool m_DRXK_A3_PATCH_CODE; bool m_rfmirror; -- cgit v1.2.3 From 94af1b63d866289aabad0514f5c8ecf223f502fb Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Mon, 29 Oct 2012 07:58:59 -0200 Subject: [media] drxk_hard: fix the return code from an error handler MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit While it is very unlikely, if the number of parameters for QAMDemodulatorCommand is not 2 or 4, status become undefined: /home/hans/work/build/v4l-dvb-git/drivers/media/dvb-frontends/drxk_hard.c: In function ‘QAMDemodulatorCommand’: /home/hans/work/build/v4l-dvb-git/drivers/media/dvb-frontends/drxk_hard.c:5452:5: warning: ‘status’ may be used uninitialized in this function [-Wuninitialized] Signed-off-by: Mauro Carvalho Chehab --- drivers/media/dvb-frontends/drxk_hard.c | 1 + 1 file changed, 1 insertion(+) (limited to 'drivers/media/dvb-frontends/drxk_hard.c') diff --git a/drivers/media/dvb-frontends/drxk_hard.c b/drivers/media/dvb-frontends/drxk_hard.c index 59382fbb3286..76a4e5cf8730 100644 --- a/drivers/media/dvb-frontends/drxk_hard.c +++ b/drivers/media/dvb-frontends/drxk_hard.c @@ -5446,6 +5446,7 @@ static int QAMDemodulatorCommand(struct drxk_state *state, } else { printk(KERN_WARNING "drxk: Unknown QAM demodulator parameter " "count %d\n", numberOfParameters); + status = -EINVAL; } error: -- cgit v1.2.3