[CIFS] Avoid extra large buffer allocation (and memcpy) in cifs_readpages
[firefly-linux-kernel-4.4.55.git] / drivers / media / dvb / frontends / nxt200x.c
index aee170805caf1fadd4d0255963c3665277884c05..84b62881cea7f81b459924b5b1646d2c07b246a0 100644 (file)
@@ -44,6 +44,8 @@
 #include <linux/init.h>
 #include <linux/module.h>
 #include <linux/moduleparam.h>
+#include <linux/slab.h>
+#include <linux/string.h>
 
 #include "dvb_frontend.h"
 #include "dvb-pll.h"
@@ -239,26 +241,16 @@ static int nxt200x_readreg_multibyte (struct nxt200x_state* state, u8 reg, u8* d
                        buf = 0x80;
                        nxt200x_writebytes(state, 0x21, &buf, 1);
 
-                       /* read status */
-                       nxt200x_readbytes(state, 0x21, &buf, 1);
-
-                       if (buf == 0)
-                       {
-                               /* read the actual data */
-                               for(i = 0; i < len; i++) {
-                    nxt200x_readbytes(state, 0x36 + i, &data[i], 1);
-                               }
-                               return 0;
+                       /* read the actual data */
+                       for(i = 0; i < len; i++) {
+                               nxt200x_readbytes(state, 0x36 + i, &data[i], 1);
                        }
+                       return 0;
                        break;
                default:
                        return -EINVAL;
                        break;
        }
-
-       printk(KERN_WARNING "nxt200x: Error reading multireg register 0x%02X\n",reg);
-
-       return 0;
 }
 
 static void nxt200x_microcontroller_stop (struct nxt200x_state* state)
@@ -566,13 +558,18 @@ static int nxt200x_setup_frontend_parameters (struct dvb_frontend* fe,
                        if (state->config->set_ts_params)
                                state->config->set_ts_params(fe, 1);
 
-                       /* set to use cable input */
-                       buf[3] |= 0x08;
+                       /* set input */
+                       if (state->config->set_pll_input)
+                               state->config->set_pll_input(buf, 1);
                        break;
                case VSB_8:
                        /* Set non-punctured clock for VSB */
                        if (state->config->set_ts_params)
                                state->config->set_ts_params(fe, 0);
+
+                       /* set input */
+                       if (state->config->set_pll_input)
+                               state->config->set_pll_input(buf, 0);
                        break;
                default:
                        return -EINVAL;