V4L/DVB: drivers/media: drop redundant memset
[safe/jmp/linux-2.6] / drivers / media / dvb / bt8xx / dst.c
index e908e3c..248a2a9 100644 (file)
@@ -71,6 +71,7 @@ MODULE_PARM_DESC(dst_algo, "tuning algo: default is 0=(SW), 1=(HW)");
        }                                                               \
 } while(0)
 
+static int dst_command(struct dst_state *state, u8 *data, u8 len);
 
 static void dst_packsize(struct dst_state *state, int psize)
 {
@@ -80,7 +81,8 @@ static void dst_packsize(struct dst_state *state, int psize)
        bt878_device_control(state->bt, DST_IG_TS, &bits);
 }
 
-int dst_gpio_outb(struct dst_state *state, u32 mask, u32 enbb, u32 outhigh, int delay)
+static int dst_gpio_outb(struct dst_state *state, u32 mask, u32 enbb,
+                        u32 outhigh, int delay)
 {
        union dst_gpio_packet enb;
        union dst_gpio_packet bits;
@@ -109,9 +111,8 @@ int dst_gpio_outb(struct dst_state *state, u32 mask, u32 enbb, u32 outhigh, int
 
        return 0;
 }
-EXPORT_SYMBOL(dst_gpio_outb);
 
-int dst_gpio_inb(struct dst_state *state, u8 *result)
+static int dst_gpio_inb(struct dst_state *state, u8 *result)
 {
        union dst_gpio_packet rd_packet;
        int err;
@@ -125,7 +126,6 @@ int dst_gpio_inb(struct dst_state *state, u8 *result)
 
        return 0;
 }
-EXPORT_SYMBOL(dst_gpio_inb);
 
 int rdc_reset_state(struct dst_state *state)
 {
@@ -145,7 +145,7 @@ int rdc_reset_state(struct dst_state *state)
 }
 EXPORT_SYMBOL(rdc_reset_state);
 
-int rdc_8820_reset(struct dst_state *state)
+static int rdc_8820_reset(struct dst_state *state)
 {
        dprintk(verbose, DST_DEBUG, 1, "Resetting DST");
        if (dst_gpio_outb(state, RDC_8820_RESET, RDC_8820_RESET, 0, NO_DELAY) < 0) {
@@ -160,9 +160,8 @@ int rdc_8820_reset(struct dst_state *state)
 
        return 0;
 }
-EXPORT_SYMBOL(rdc_8820_reset);
 
-int dst_pio_enable(struct dst_state *state)
+static int dst_pio_enable(struct dst_state *state)
 {
        if (dst_gpio_outb(state, ~0, RDC_8820_PIO_0_ENABLE, 0, NO_DELAY) < 0) {
                dprintk(verbose, DST_ERROR, 1, "dst_gpio_outb ERROR !");
@@ -172,7 +171,6 @@ int dst_pio_enable(struct dst_state *state)
 
        return 0;
 }
-EXPORT_SYMBOL(dst_pio_enable);
 
 int dst_pio_disable(struct dst_state *state)
 {
@@ -611,7 +609,7 @@ static int dst_type_print(struct dst_state *state, u8 type)
        return 0;
 }
 
-struct tuner_types tuner_list[] = {
+static struct tuner_types tuner_list[] = {
        {
                .tuner_type = TUNER_TYPE_L64724,
                .tuner_name = "L 64724",
@@ -919,9 +917,7 @@ static int dst_get_mac(struct dst_state *state)
        }
        memset(&state->mac_address, '\0', 8);
        memcpy(&state->mac_address, &state->rxbuffer, 6);
-       dprintk(verbose, DST_ERROR, 1, "MAC Address=[%02x:%02x:%02x:%02x:%02x:%02x]",
-               state->mac_address[0], state->mac_address[1], state->mac_address[2],
-               state->mac_address[4], state->mac_address[5], state->mac_address[6]);
+       dprintk(verbose, DST_ERROR, 1, "MAC Address=[%pM]", state->mac_address);
 
        return 0;
 }
@@ -934,7 +930,6 @@ static int dst_fw_ver(struct dst_state *state)
                dprintk(verbose, DST_INFO, 1, "Unsupported Command");
                return -1;
        }
-       memset(&state->fw_version, '\0', 8);
        memcpy(&state->fw_version, &state->rxbuffer, 8);
        dprintk(verbose, DST_ERROR, 1, "Firmware Ver = %x.%x Build = %02x, on %x:%x, %x-%x-20%02x",
                state->fw_version[0] >> 4, state->fw_version[0] & 0x0f,
@@ -1057,13 +1052,12 @@ static int dst_get_tuner_info(struct dst_state *state)
                        goto force;
                }
        }
-       memset(&state->board_info, '\0', 8);
        memcpy(&state->board_info, &state->rxbuffer, 8);
        if (state->type_flags & DST_TYPE_HAS_MULTI_FE) {
                dprintk(verbose, DST_ERROR, 1, "DST type has TS=188");
        }
        if (state->board_info[0] == 0xbc) {
-               if (state->type_flags != DST_TYPE_IS_ATSC)
+               if (state->dst_type != DST_TYPE_IS_ATSC)
                        state->type_flags |= DST_TYPE_HAS_TS188;
                else
                        state->type_flags |= DST_TYPE_HAS_NEWTUNE_2;
@@ -1224,7 +1218,7 @@ static int dst_probe(struct dst_state *state)
        return 0;
 }
 
-int dst_command(struct dst_state *state, u8 *data, u8 len)
+static int dst_command(struct dst_state *state, u8 *data, u8 len)
 {
        u8 reply;
 
@@ -1246,7 +1240,7 @@ int dst_command(struct dst_state *state, u8 *data, u8 len)
                goto error;
        }
        if (state->type_flags & DST_TYPE_HAS_FW_1)
-               udelay(3000);
+               mdelay(3);
        if (read_dst(state, &reply, GET_ACK)) {
                dprintk(verbose, DST_DEBUG, 1, "Trying to recover.. ");
                if ((dst_error_recovery(state)) < 0) {
@@ -1262,7 +1256,7 @@ int dst_command(struct dst_state *state, u8 *data, u8 len)
        if (len >= 2 && data[0] == 0 && (data[1] == 1 || data[1] == 3))
                goto error;
        if (state->type_flags & DST_TYPE_HAS_FW_1)
-               udelay(3000);
+               mdelay(3);
        else
                udelay(2000);
        if (!dst_wait_dst_ready(state, NO_DELAY))
@@ -1287,13 +1281,12 @@ error:
        return -EIO;
 
 }
-EXPORT_SYMBOL(dst_command);
 
 static int dst_get_signal(struct dst_state *state)
 {
        int retval;
        u8 get_signal[] = { 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfb };
-       //dprintk("%s: Getting Signal strength and other parameters\n", __FUNCTION__);
+       //dprintk("%s: Getting Signal strength and other parameters\n", __func__);
        if ((state->diseq_flags & ATTEMPT_TUNE) == 0) {
                state->decode_lock = state->decode_strength = state->decode_snr = 0;
                return 0;
@@ -1357,8 +1350,7 @@ static int dst_get_tuna(struct dst_state *state)
                return retval;
        }
        if ((state->type_flags & DST_TYPE_HAS_VLF) &&
-               !(state->dst_type == DST_TYPE_IS_CABLE) &&
-               !(state->dst_type == DST_TYPE_IS_ATSC)) {
+          !(state->dst_type == DST_TYPE_IS_ATSC)) {
 
                if (state->rx_tuna[9] != dst_check_sum(&state->rx_tuna[0], 9)) {
                        dprintk(verbose, DST_INFO, 1, "checksum failure ? ");
@@ -1652,7 +1644,7 @@ static int dst_set_frontend(struct dvb_frontend *fe, struct dvb_frontend_paramet
 static int dst_tune_frontend(struct dvb_frontend* fe,
                            struct dvb_frontend_parameters* p,
                            unsigned int mode_flags,
-                           int *delay,
+                           unsigned int *delay,
                            fe_status_t *status)
 {
        struct dst_state *state = fe->demodulator_priv;
@@ -1688,7 +1680,7 @@ static int dst_tune_frontend(struct dvb_frontend* fe,
 
 static int dst_get_tuning_algo(struct dvb_frontend *fe)
 {
-       return dst_algo;
+       return dst_algo ? DVBFE_ALGO_HW : DVBFE_ALGO_SW;
 }
 
 static int dst_get_frontend(struct dvb_frontend *fe, struct dvb_frontend_parameters *p)
@@ -1717,7 +1709,7 @@ static void dst_release(struct dvb_frontend *fe)
        struct dst_state *state = fe->demodulator_priv;
        if (state->dst_ca) {
                dvb_unregister_device(state->dst_ca);
-#ifdef CONFIG_DVB_CORE_ATTACH
+#ifdef CONFIG_MEDIA_ATTACH
                symbol_put(dst_ca_attach);
 #endif
        }
@@ -1825,8 +1817,13 @@ static struct dvb_frontend_ops dst_dvbc_ops = {
                .frequency_max = 858000000,
                .symbol_rate_min = 1000000,
                .symbol_rate_max = 45000000,
-       /*     . symbol_rate_tolerance  =       ???,*/
-               .caps = FE_CAN_FEC_AUTO | FE_CAN_QAM_AUTO
+               .caps = FE_CAN_FEC_AUTO |
+                       FE_CAN_QAM_AUTO |
+                       FE_CAN_QAM_16   |
+                       FE_CAN_QAM_32   |
+                       FE_CAN_QAM_64   |
+                       FE_CAN_QAM_128  |
+                       FE_CAN_QAM_256
        },
 
        .release = dst_release,