提交 d3ec72b0 编写于 作者: W Wolfram Sang 提交者: Greg Kroah-Hartman

usb: misc: ftdi-elan: don't print error when allocating urb fails

kmalloc will print enough information in case of failure.
Signed-off-by: NWolfram Sang <wsa-dev@sang-engineering.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 c6b1caaf
...@@ -782,11 +782,8 @@ static int ftdi_elan_command_engine(struct usb_ftdi *ftdi) ...@@ -782,11 +782,8 @@ static int ftdi_elan_command_engine(struct usb_ftdi *ftdi)
return 0; return 0;
total_size = ftdi_elan_total_command_size(ftdi, command_size); total_size = ftdi_elan_total_command_size(ftdi, command_size);
urb = usb_alloc_urb(0, GFP_KERNEL); urb = usb_alloc_urb(0, GFP_KERNEL);
if (!urb) { if (!urb)
dev_err(&ftdi->udev->dev, "could not get a urb to write %d commands totaling %d bytes to the Uxxx\n",
command_size, total_size);
return -ENOMEM; return -ENOMEM;
}
buf = usb_alloc_coherent(ftdi->udev, total_size, GFP_KERNEL, buf = usb_alloc_coherent(ftdi->udev, total_size, GFP_KERNEL,
&urb->transfer_dma); &urb->transfer_dma);
if (!buf) { if (!buf) {
...@@ -1945,10 +1942,8 @@ static int ftdi_elan_synchronize_flush(struct usb_ftdi *ftdi) ...@@ -1945,10 +1942,8 @@ static int ftdi_elan_synchronize_flush(struct usb_ftdi *ftdi)
int I = 257; int I = 257;
int i = 0; int i = 0;
urb = usb_alloc_urb(0, GFP_KERNEL); urb = usb_alloc_urb(0, GFP_KERNEL);
if (!urb) { if (!urb)
dev_err(&ftdi->udev->dev, "could not alloc a urb for flush sequence\n");
return -ENOMEM; return -ENOMEM;
}
buf = usb_alloc_coherent(ftdi->udev, I, GFP_KERNEL, &urb->transfer_dma); buf = usb_alloc_coherent(ftdi->udev, I, GFP_KERNEL, &urb->transfer_dma);
if (!buf) { if (!buf) {
dev_err(&ftdi->udev->dev, "could not get a buffer for flush sequence\n"); dev_err(&ftdi->udev->dev, "could not get a buffer for flush sequence\n");
...@@ -1985,10 +1980,8 @@ static int ftdi_elan_synchronize_reset(struct usb_ftdi *ftdi) ...@@ -1985,10 +1980,8 @@ static int ftdi_elan_synchronize_reset(struct usb_ftdi *ftdi)
int I = 4; int I = 4;
int i = 0; int i = 0;
urb = usb_alloc_urb(0, GFP_KERNEL); urb = usb_alloc_urb(0, GFP_KERNEL);
if (!urb) { if (!urb)
dev_err(&ftdi->udev->dev, "could not get a urb for the reset sequence\n");
return -ENOMEM; return -ENOMEM;
}
buf = usb_alloc_coherent(ftdi->udev, I, GFP_KERNEL, &urb->transfer_dma); buf = usb_alloc_coherent(ftdi->udev, I, GFP_KERNEL, &urb->transfer_dma);
if (!buf) { if (!buf) {
dev_err(&ftdi->udev->dev, "could not get a buffer for the reset sequence\n"); dev_err(&ftdi->udev->dev, "could not get a buffer for the reset sequence\n");
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册