Lines Matching refs:data_arg
314 struct i2c_smbus_ioctl_data data_arg;
318 if (copy_from_user(&data_arg,
322 if ((data_arg.size != I2C_SMBUS_BYTE) &&
323 (data_arg.size != I2C_SMBUS_QUICK) &&
324 (data_arg.size != I2C_SMBUS_BYTE_DATA) &&
325 (data_arg.size != I2C_SMBUS_WORD_DATA) &&
326 (data_arg.size != I2C_SMBUS_PROC_CALL) &&
327 (data_arg.size != I2C_SMBUS_BLOCK_DATA) &&
328 (data_arg.size != I2C_SMBUS_I2C_BLOCK_BROKEN) &&
329 (data_arg.size != I2C_SMBUS_I2C_BLOCK_DATA) &&
330 (data_arg.size != I2C_SMBUS_BLOCK_PROC_CALL)) {
333 data_arg.size);
338 if ((data_arg.read_write != I2C_SMBUS_READ) &&
339 (data_arg.read_write != I2C_SMBUS_WRITE)) {
342 data_arg.read_write);
348 if ((data_arg.size == I2C_SMBUS_QUICK) ||
349 ((data_arg.size == I2C_SMBUS_BYTE) &&
350 (data_arg.read_write == I2C_SMBUS_WRITE)))
353 client->flags, data_arg.read_write,
354 data_arg.command, data_arg.size, NULL);
356 if (data_arg.data == NULL) {
362 if ((data_arg.size == I2C_SMBUS_BYTE_DATA) ||
363 (data_arg.size == I2C_SMBUS_BYTE))
364 datasize = sizeof(data_arg.data->byte);
365 else if ((data_arg.size == I2C_SMBUS_WORD_DATA) ||
366 (data_arg.size == I2C_SMBUS_PROC_CALL))
367 datasize = sizeof(data_arg.data->word);
369 datasize = sizeof(data_arg.data->block);
371 if ((data_arg.size == I2C_SMBUS_PROC_CALL) ||
372 (data_arg.size == I2C_SMBUS_BLOCK_PROC_CALL) ||
373 (data_arg.size == I2C_SMBUS_I2C_BLOCK_DATA) ||
374 (data_arg.read_write == I2C_SMBUS_WRITE)) {
375 if (copy_from_user(&temp, data_arg.data, datasize))
378 if (data_arg.size == I2C_SMBUS_I2C_BLOCK_BROKEN) {
381 data_arg.size = I2C_SMBUS_I2C_BLOCK_DATA;
382 if (data_arg.read_write == I2C_SMBUS_READ)
386 data_arg.read_write, data_arg.command, data_arg.size, &temp);
387 if (!res && ((data_arg.size == I2C_SMBUS_PROC_CALL) ||
388 (data_arg.size == I2C_SMBUS_BLOCK_PROC_CALL) ||
389 (data_arg.read_write == I2C_SMBUS_READ))) {
390 if (copy_to_user(data_arg.data, &temp, datasize))