};
 
 static int si2165_write(struct si2165_state *state, const u16 reg,
-                      const u8 *src, const int count)
+                       const u8 *src, const int count)
 {
        int ret;
 
-       dev_dbg(&state->client->dev, "i2c write: reg: 0x%04x, data: %*ph\n", reg, count, src);
+       dev_dbg(&state->client->dev, "i2c write: reg: 0x%04x, data: %*ph\n",
+               reg, count, src);
 
        ret = regmap_bulk_write(state->regmap, reg, src, count);
 
                return ret;
        }
 
-       dev_dbg(&state->client->dev, "i2c read: reg: 0x%04x, data: %*ph\n", reg, count, val);
+       dev_dbg(&state->client->dev, "i2c read: reg: 0x%04x, data: %*ph\n",
+               reg, count, val);
 
        return 0;
 }
 
 static int si2165_readreg8(struct si2165_state *state,
-                      const u16 reg, u8 *val)
+                          const u16 reg, u8 *val)
 {
        unsigned int val_tmp;
        int ret = regmap_read(state->regmap, reg, &val_tmp);
 }
 
 static int si2165_readreg16(struct si2165_state *state,
-                      const u16 reg, u16 *val)
+                           const u16 reg, u16 *val)
 {
        u8 buf[2];
 
        return si2165_writereg8(state, reg, val);
 }
 
-#define REG16(reg, val) { (reg), (val) & 0xff }, { (reg)+1, (val)>>8 & 0xff }
+#define REG16(reg, val) \
+       { (reg), (val) & 0xff }, \
+       { (reg) + 1, (val) >> 8 & 0xff }
 struct si2165_reg_value_pair {
        u16 reg;
        u8 val;
 
 static int si2165_init_pll(struct si2165_state *state)
 {
-       u32 ref_freq_Hz = state->config.ref_freq_Hz;
+       u32 ref_freq_hz = state->config.ref_freq_hz;
        u8 divr = 1; /* 1..7 */
        u8 divp = 1; /* only 1 or 4 */
        u8 divn = 56; /* 1..63 */
         * hardcoded values can be deleted if calculation is verified
         * or it yields the same values as the windows driver
         */
-       switch (ref_freq_Hz) {
+       switch (ref_freq_hz) {
        case 16000000u:
                divn = 56;
                break;
                break;
        default:
                /* ref_freq / divr must be between 4 and 16 MHz */
-               if (ref_freq_Hz > 16000000u)
+               if (ref_freq_hz > 16000000u)
                        divr = 2;
 
                /*
                 * now select divn and divp such that
                 * fvco is in 1624..1824 MHz
                 */
-               if (1624000000u * divr > ref_freq_Hz * 2u * 63u)
+               if (1624000000u * divr > ref_freq_hz * 2u * 63u)
                        divp = 4;
 
                /* is this already correct regarding rounding? */
-               divn = 1624000000u * divr / (ref_freq_Hz * 2u * divp);
+               divn = 1624000000u * divr / (ref_freq_hz * 2u * divp);
                break;
        }
 
        /* adc_clk and sys_clk depend on xtal and pll settings */
-       state->fvco_hz = ref_freq_Hz / divr
+       state->fvco_hz = ref_freq_hz / divr
                        * 2u * divn * divp;
        state->adc_clk = state->fvco_hz / (divm * 4u);
        state->sys_clk = state->fvco_hz / (divl * 2u);
 }
 
 static int si2165_upload_firmware_block(struct si2165_state *state,
-       const u8 *data, u32 len, u32 *poffset, u32 block_count)
+                                       const u8 *data, u32 len, u32 *poffset,
+                                       u32 block_count)
 {
        int ret;
        u8 buf_ctrl[4] = { 0x00, 0x00, 0x00, 0xc0 };
                return -EINVAL;
 
        dev_dbg(&state->client->dev,
-               "fw load: si2165_upload_firmware_block called with len=0x%x offset=0x%x blockcount=0x%x\n",
-                               len, offset, block_count);
-       while (offset+12 <= len && cur_block < block_count) {
+               "fw load: %s: called with len=0x%x offset=0x%x blockcount=0x%x\n",
+               __func__, len, offset, block_count);
+       while (offset + 12 <= len && cur_block < block_count) {
                dev_dbg(&state->client->dev,
-                       "fw load: si2165_upload_firmware_block in while len=0x%x offset=0x%x cur_block=0x%x blockcount=0x%x\n",
-                                       len, offset, cur_block, block_count);
+                       "fw load: %s: in while len=0x%x offset=0x%x cur_block=0x%x blockcount=0x%x\n",
+                       __func__, len, offset, cur_block, block_count);
                wordcount = data[offset];
-               if (wordcount < 1 || data[offset+1] ||
-                   data[offset+2] || data[offset+3]) {
+               if (wordcount < 1 || data[offset + 1] ||
+                   data[offset + 2] || data[offset + 3]) {
                        dev_warn(&state->client->dev,
                                 "bad fw data[0..3] = %*ph\n",
                                 4, data);
                ret = si2165_write(state, 0x0364, buf_ctrl, 4);
                if (ret < 0)
                        goto error;
-               ret = si2165_write(state, 0x0368, data+offset+4, 4);
+               ret = si2165_write(state, 0x0368, data + offset + 4, 4);
                if (ret < 0)
                        goto error;
 
                offset += 8;
 
                while (wordcount > 0) {
-                       ret = si2165_write(state, 0x36c, data+offset, 4);
+                       ret = si2165_write(state, 0x36c, data + offset, 4);
                        if (ret < 0)
                                goto error;
                        wordcount--;
        }
 
        dev_dbg(&state->client->dev,
-               "fw load: si2165_upload_firmware_block after while len=0x%x offset=0x%x cur_block=0x%x blockcount=0x%x\n",
-                               len, offset, cur_block, block_count);
+               "fw load: %s: after while len=0x%x offset=0x%x cur_block=0x%x blockcount=0x%x\n",
+               __func__, len, offset, cur_block, block_count);
 
        if (poffset)
                *poffset = offset;
 
        dev_dbg(&state->client->dev,
-               "fw load: si2165_upload_firmware_block returned offset=0x%x\n",
-                               offset);
+               "fw load: %s: returned offset=0x%x\n",
+               __func__, offset);
 
        return 0;
 error:
                break;
        default:
                dev_info(&state->client->dev, "no firmware file for revision=%d\n",
-                       state->chip_revcode);
+                        state->chip_revcode);
                return 0;
        }
 
        ret = request_firmware(&fw, fw_file, &state->client->dev);
        if (ret) {
                dev_warn(&state->client->dev, "firmware file '%s' not found\n",
-                       fw_file);
+                        fw_file);
                goto error;
        }
 
        len = fw->size;
 
        dev_info(&state->client->dev, "downloading firmware from file '%s' size=%d\n",
-                       fw_file, len);
+                fw_file, len);
 
        if (len % 4 != 0) {
                dev_warn(&state->client->dev, "firmware size is not multiple of 4\n");
        /* start right after the header */
        offset = 8;
 
-       dev_info(&state->client->dev, "si2165_upload_firmware extracted patch_version=0x%02x, block_count=0x%02x, crc_expected=0x%04x\n",
-               patch_version, block_count, crc_expected);
+       dev_info(&state->client->dev, "%s: extracted patch_version=0x%02x, block_count=0x%02x, crc_expected=0x%04x\n",
+                __func__, patch_version, block_count, crc_expected);
 
        ret = si2165_upload_firmware_block(state, data, len, &offset, 1);
        if (ret < 0)
 };
 
 static int si2165_probe(struct i2c_client *client,
-               const struct i2c_device_id *id)
+                       const struct i2c_device_id *id)
 {
        struct si2165_state *state = NULL;
        struct si2165_platform_data *pdata = client->dev.platform_data;
        };
 
        /* allocate memory for the internal state */
-       state = kzalloc(sizeof(struct si2165_state), GFP_KERNEL);
-       if (state == NULL) {
+       state = kzalloc(sizeof(*state), GFP_KERNEL);
+       if (!state) {
                ret = -ENOMEM;
                goto error;
        }
        state->client = client;
        state->config.i2c_addr = client->addr;
        state->config.chip_mode = pdata->chip_mode;
-       state->config.ref_freq_Hz = pdata->ref_freq_Hz;
+       state->config.ref_freq_hz = pdata->ref_freq_hz;
        state->config.inversion = pdata->inversion;
 
-       if (state->config.ref_freq_Hz < 4000000
-           || state->config.ref_freq_Hz > 27000000) {
+       if (state->config.ref_freq_hz < 4000000 ||
+           state->config.ref_freq_hz > 27000000) {
                dev_err(&state->client->dev, "ref_freq of %d Hz not supported by this driver\n",
-                        state->config.ref_freq_Hz);
+                       state->config.ref_freq_hz);
                ret = -EINVAL;
                goto error;
        }
 
        /* create dvb_frontend */
        memcpy(&state->fe.ops, &si2165_ops,
-               sizeof(struct dvb_frontend_ops));
+              sizeof(struct dvb_frontend_ops));
        state->fe.ops.release = NULL;
        state->fe.demodulator_priv = state;
        i2c_set_clientdata(client, state);
        }
 
        dev_info(&state->client->dev,
-               "Detected Silicon Labs %s-%c (type %d, rev %d)\n",
+                "Detected Silicon Labs %s-%c (type %d, rev %d)\n",
                chip_name, rev_char, state->chip_type,
                state->chip_revcode);
 
        strlcat(state->fe.ops.info.name, chip_name,
-                       sizeof(state->fe.ops.info.name));
+               sizeof(state->fe.ops.info.name));
 
        n = 0;
        if (state->has_dvbt) {