Updated from Linux LTS 3.10.21 to 3.10.22
This commit is contained in:
@@ -36,6 +36,8 @@
|
||||
#include "mt312_priv.h"
|
||||
#include "mt312.h"
|
||||
|
||||
/* Max transfer size done by I2C transfer functions */
|
||||
#define MAX_XFER_SIZE 64
|
||||
|
||||
struct mt312_state {
|
||||
struct i2c_adapter *i2c;
|
||||
@@ -96,9 +98,15 @@ static int mt312_write(struct mt312_state *state, const enum mt312_reg_addr reg,
|
||||
const u8 *src, const size_t count)
|
||||
{
|
||||
int ret;
|
||||
u8 buf[count + 1];
|
||||
u8 buf[MAX_XFER_SIZE];
|
||||
struct i2c_msg msg;
|
||||
|
||||
if (1 + count > sizeof(buf)) {
|
||||
printk(KERN_WARNING
|
||||
"mt312: write: len=%zd is too big!\n", count);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (debug) {
|
||||
int i;
|
||||
dprintk("W(%d):", reg & 0x7f);
|
||||
|
||||
Reference in New Issue
Block a user