cp210x_buffer_t t;
if (!kbuf || !ubuf || !klen ||
- copy_from_user(&t, (cp210x_buffer_t *)ubuf, sizeof(t)))
+ copy_from_user(&t, (cp210x_buffer_t __user *)ubuf,
+ sizeof(t)))
return 0;
if (t.len < klen)
klen = t.len;
- if (!t.buf || !t.len || copy_from_user(kbuf, t.buf, klen))
+ if (!t.buf || !t.len ||
+ copy_from_user(kbuf, (char __user *)t.buf, klen))
return 0;
return klen;
}
* connections are torn down. We also ignore the error return, since
* the part resets and doesn't send one...
*/
- cp210x_ctlmsg(port, 0xff, 0x40, 0x0008, 0x00, 0, 0);
+ cp210x_ctlmsg(port, 0xff, 0x40, 0x0008, 0x00, NULL, 0);
#else
usb_reset_device(port->serial->dev);
#endif
unsigned int value)
{
return cp210x_ctlmsg(port, 0xff, 0x40, 0x3700 | (cmd & 0xff),
- value, 0, 0);
+ value, NULL, 0);
}
/* Populates usbstr with: (len) + (0x03) + unicode(str). Each char in str
dbg("%s - port %d, gpio = 0x%.2x", __FUNCTION__, port->number, gpio);
return cp210x_ctlmsg(port, 0xff, 0x40, 0x37e1,
- ((uint16_t)gpio << 8) | GPIO_MASK, 0, 0);
+ ((uint16_t)gpio << 8) | GPIO_MASK, NULL, 0);
}
/* Set select gpio bits */
dbg("%s - port %d, gpiob = 0x%.4x", __FUNCTION__, port->number, gpio);
/* FIXME: how about REQTYPE_HOST_TO_DEVICE instead of 0x40? */
- return cp210x_ctlmsg(port, 0xff, 0x40, 0x37e1, gpio, 0, 0);
+ return cp210x_ctlmsg(port, 0xff, 0x40, 0x37e1, gpio, NULL, 0);
}
static int cp210x_gpioget(struct usb_serial_port *port, u8 *gpio)
case TIOCMGET:
{
int result = cp210x_tiocmget(tty, file);
- if (copy_to_user(&arg, &result, sizeof(int)))
+ if (copy_to_user((int __user *)&arg, &result, sizeof(int)))
return -EFAULT;
return 0;
}
case TIOCMSET:
case TIOCMBIS:
-
case TIOCMBIC:
{
int val = 0;
- if (copy_from_user(&val, &arg, sizeof(int)))
+ if (copy_from_user(&val, (int __user *)&arg, sizeof(int)))
return -EFAULT;
/* this looks wrong: TIOCMSET isn't going to work right */
case IOCTL_GPIOGET:
if (cp210x_get_partnum(port) == CP210x_CP2103_VERSION) {
u8 gpio = 0;
- if (!cp210x_gpioget(port, &gpio) && !copy_to_user((u8*)arg,
- &gpio, sizeof(gpio)))
+ if (!cp210x_gpioget(port, &gpio) && !copy_to_user(
+ (u8 __user *)arg, &gpio, sizeof(gpio)))
return 0;
}
return -EFAULT;
{
cp210x_port_config_t config;
if (!cp210x_portconfget(port, &config) && !copy_to_user(
- (cp210x_port_config_t*)arg, &config,
- sizeof(config)))
+ (cp210x_port_config_t __user *)arg,
+ &config, sizeof(config)))
return 0;
}
return -EFAULT;
case IOCTL_PORTCONFSET:
{
cp210x_port_config_t config;
- if (!copy_from_user(&config, (cp210x_port_config_t*)arg,
+ if (!copy_from_user(&config, (cp210x_port_config_t __user *)arg,
sizeof(config)) &&
!cp210x_portconfset(port, &config))
return 0;
case IOCTL_SETVID:
{
unsigned int vid;
- if (!copy_from_user(&vid, (unsigned int *)arg,
+ if (!copy_from_user(&vid, (unsigned int __user *)arg,
sizeof(unsigned int)) &&
!cp210x_setu16(port, 0x01, vid))
return 0;
case IOCTL_SETPID:
{
unsigned int pid;
- if (!copy_from_user(&pid, (unsigned int *)arg,
+ if (!copy_from_user(&pid, (unsigned int __user *)arg,
sizeof(unsigned int)) &&
!cp210x_setu16(port, 0x02, pid))
return 0;
case IOCTL_SETDEVVER:
{
unsigned int ver;
- if (!copy_from_user(&ver, (unsigned int *)arg,
+ if (!copy_from_user(&ver, (unsigned int __user *)arg,
sizeof(unsigned int)) &&
!cp210x_setu16(port, 0x07, ver))
return 0;