Commit 3800178b authored by YAMANE Toshiaki's avatar YAMANE Toshiaki Committed by Greg Kroah-Hartman

staging/gdm72xx: Use dev_ printks in usb_boot.c

fixed below checkpatch warnings.
- WARNING: Prefer netdev_err(netdev, ... then dev_err(dev, ... then pr_err(...  to printk(KERN_ERR ...
- WARNING: Prefer netdev_info(netdev, ... then dev_info(dev, ... then pr_info(...  to printk(KERN_INFO ...
Signed-off-by: default avatarYAMANE Toshiaki <yamanetoshi@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent a7d46832
...@@ -82,7 +82,8 @@ static int gdm_wibro_send(struct usb_device *usbdev, void *data, int len) ...@@ -82,7 +82,8 @@ static int gdm_wibro_send(struct usb_device *usbdev, void *data, int len)
&actual, 1000); &actual, 1000);
if (ret < 0) { if (ret < 0) {
printk(KERN_ERR "Error : usb_bulk_msg ( result = %d )\n", ret); dev_err(&usbdev->dev, "Error : usb_bulk_msg ( result = %d )\n",
ret);
return ret; return ret;
} }
return 0; return 0;
...@@ -97,8 +98,8 @@ static int gdm_wibro_recv(struct usb_device *usbdev, void *data, int len) ...@@ -97,8 +98,8 @@ static int gdm_wibro_recv(struct usb_device *usbdev, void *data, int len)
&actual, 5000); &actual, 5000);
if (ret < 0) { if (ret < 0) {
printk(KERN_ERR "Error : usb_bulk_msg(recv) ( result = %d )\n", dev_err(&usbdev->dev,
ret); "Error : usb_bulk_msg(recv) ( result = %d )\n", ret);
return ret; return ret;
} }
return 0; return 0;
...@@ -150,20 +151,20 @@ int usb_boot(struct usb_device *usbdev, u16 pid) ...@@ -150,20 +151,20 @@ int usb_boot(struct usb_device *usbdev, u16 pid)
ret = request_firmware(&firm, img_name, &usbdev->dev); ret = request_firmware(&firm, img_name, &usbdev->dev);
if (ret < 0) { if (ret < 0) {
printk(KERN_ERR dev_err(&usbdev->dev,
"requesting firmware %s failed with error %d\n", "requesting firmware %s failed with error %d\n",
img_name, ret); img_name, ret);
return ret; return ret;
} }
tx_buf = kmalloc(DOWNLOAD_SIZE, GFP_KERNEL); tx_buf = kmalloc(DOWNLOAD_SIZE, GFP_KERNEL);
if (tx_buf == NULL) { if (tx_buf == NULL) {
printk(KERN_ERR "Error: kmalloc\n"); dev_err(&usbdev->dev, "Error: kmalloc\n");
return -ENOMEM; return -ENOMEM;
} }
if (firm->size < sizeof(hdr)) { if (firm->size < sizeof(hdr)) {
printk(KERN_ERR "gdmwm: Cannot read the image info.\n"); dev_err(&usbdev->dev, "Cannot read the image info.\n");
ret = -EIO; ret = -EIO;
goto out; goto out;
} }
...@@ -172,23 +173,22 @@ int usb_boot(struct usb_device *usbdev, u16 pid) ...@@ -172,23 +173,22 @@ int usb_boot(struct usb_device *usbdev, u16 pid)
array_le32_to_cpu((u32 *)&hdr, 19); array_le32_to_cpu((u32 *)&hdr, 19);
#if 0 #if 0
if (hdr.magic_code != 0x10767fff) { if (hdr.magic_code != 0x10767fff) {
printk(KERN_ERR "gdmwm: Invalid magic code 0x%08x\n", dev_err(&usbdev->dev, "Invalid magic code 0x%08x\n",
hdr.magic_code); hdr.magic_code);
ret = -EINVAL; ret = -EINVAL;
goto out; goto out;
} }
#endif #endif
if (hdr.count > MAX_IMG_CNT) { if (hdr.count > MAX_IMG_CNT) {
printk(KERN_ERR "gdmwm: Too many images. %d\n", hdr.count); dev_err(&usbdev->dev, "Too many images. %d\n", hdr.count);
ret = -EINVAL; ret = -EINVAL;
goto out; goto out;
} }
for (i = 0; i < hdr.count; i++) { for (i = 0; i < hdr.count; i++) {
if (hdr.offset[i] > hdr.len) { if (hdr.offset[i] > hdr.len) {
printk(KERN_ERR "gdmwm: Invalid offset. " dev_err(&usbdev->dev,
"Entry = %d Offset = 0x%08x " "Invalid offset. Entry = %d Offset = 0x%08x Image length = 0x%08x\n",
"Image length = 0x%08x\n",
i, hdr.offset[i], hdr.len); i, hdr.offset[i], hdr.len);
ret = -EINVAL; ret = -EINVAL;
goto out; goto out;
...@@ -196,7 +196,7 @@ int usb_boot(struct usb_device *usbdev, u16 pid) ...@@ -196,7 +196,7 @@ int usb_boot(struct usb_device *usbdev, u16 pid)
pos = hdr.offset[i]; pos = hdr.offset[i];
if (firm->size < sizeof(fw_info) + pos) { if (firm->size < sizeof(fw_info) + pos) {
printk(KERN_ERR "gdmwm: Cannot read the FW info.\n"); dev_err(&usbdev->dev, "Cannot read the FW info.\n");
ret = -EIO; ret = -EIO;
goto out; goto out;
} }
...@@ -205,7 +205,7 @@ int usb_boot(struct usb_device *usbdev, u16 pid) ...@@ -205,7 +205,7 @@ int usb_boot(struct usb_device *usbdev, u16 pid)
array_le32_to_cpu((u32 *)&fw_info, 8); array_le32_to_cpu((u32 *)&fw_info, 8);
#if 0 #if 0
if ((fw_info.id & 0xfffff000) != 0x10767000) { if ((fw_info.id & 0xfffff000) != 0x10767000) {
printk(KERN_ERR "gdmwm: Invalid FW id. 0x%08x\n", dev_err(&usbdev->dev, "Invalid FW id. 0x%08x\n",
fw_info.id); fw_info.id);
ret = -EIO; ret = -EIO;
goto out; goto out;
...@@ -217,7 +217,7 @@ int usb_boot(struct usb_device *usbdev, u16 pid) ...@@ -217,7 +217,7 @@ int usb_boot(struct usb_device *usbdev, u16 pid)
pos = hdr.offset[i] + fw_info.kernel_offset; pos = hdr.offset[i] + fw_info.kernel_offset;
if (firm->size < fw_info.kernel_len + pos) { if (firm->size < fw_info.kernel_len + pos) {
printk(KERN_ERR "gdmwm: Kernel FW is too small.\n"); dev_err(&usbdev->dev, "Kernel FW is too small.\n");
goto out; goto out;
} }
...@@ -225,24 +225,25 @@ int usb_boot(struct usb_device *usbdev, u16 pid) ...@@ -225,24 +225,25 @@ int usb_boot(struct usb_device *usbdev, u16 pid)
fw_info.kernel_len, DN_KERNEL_MAGIC_NUMBER); fw_info.kernel_len, DN_KERNEL_MAGIC_NUMBER);
if (ret < 0) if (ret < 0)
goto out; goto out;
printk(KERN_INFO "GCT: Kernel download success.\n"); dev_info(&usbdev->dev, "GCT: Kernel download success.\n");
pos = hdr.offset[i] + fw_info.rootfs_offset; pos = hdr.offset[i] + fw_info.rootfs_offset;
if (firm->size < fw_info.rootfs_len + pos) { if (firm->size < fw_info.rootfs_len + pos) {
printk(KERN_ERR "gdmwm: Filesystem FW is too small.\n"); dev_err(&usbdev->dev, "Filesystem FW is too small.\n");
goto out; goto out;
} }
ret = download_image(usbdev, firm, pos, fw_info.rootfs_len, ret = download_image(usbdev, firm, pos, fw_info.rootfs_len,
DN_ROOTFS_MAGIC_NUMBER); DN_ROOTFS_MAGIC_NUMBER);
if (ret < 0) if (ret < 0)
goto out; goto out;
printk(KERN_INFO "GCT: Filesystem download success.\n"); dev_info(&usbdev->dev, "GCT: Filesystem download success.\n");
break; break;
} }
if (i == hdr.count) { if (i == hdr.count) {
printk(KERN_ERR "Firmware for gsk%x is not installed.\n", pid); dev_err(&usbdev->dev, "Firmware for gsk%x is not installed.\n",
pid);
ret = -EINVAL; ret = -EINVAL;
} }
out: out:
...@@ -293,15 +294,15 @@ static int em_download_image(struct usb_device *usbdev, const char *img_name, ...@@ -293,15 +294,15 @@ static int em_download_image(struct usb_device *usbdev, const char *img_name,
ret = request_firmware(&firm, img_name, &usbdev->dev); ret = request_firmware(&firm, img_name, &usbdev->dev);
if (ret < 0) { if (ret < 0) {
printk(KERN_ERR dev_err(&usbdev->dev,
"requesting firmware %s failed with error %d\n", "requesting firmware %s failed with error %d\n",
img_name, ret); img_name, ret);
return ret; return ret;
} }
buf = kmalloc(DOWNLOAD_CHUCK + pad_size, GFP_KERNEL); buf = kmalloc(DOWNLOAD_CHUCK + pad_size, GFP_KERNEL);
if (buf == NULL) { if (buf == NULL) {
printk(KERN_ERR "Error: kmalloc\n"); dev_err(&usbdev->dev, "Error: kmalloc\n");
return -ENOMEM; return -ENOMEM;
} }
...@@ -366,12 +367,12 @@ int usb_emergency(struct usb_device *usbdev) ...@@ -366,12 +367,12 @@ int usb_emergency(struct usb_device *usbdev)
ret = em_download_image(usbdev, kern_name, KERNEL_TYPE_STRING); ret = em_download_image(usbdev, kern_name, KERNEL_TYPE_STRING);
if (ret < 0) if (ret < 0)
return ret; return ret;
printk(KERN_INFO "GCT Emergency: Kernel download success.\n"); dev_err(&usbdev->dev, "GCT Emergency: Kernel download success.\n");
ret = em_download_image(usbdev, fs_name, FS_TYPE_STRING); ret = em_download_image(usbdev, fs_name, FS_TYPE_STRING);
if (ret < 0) if (ret < 0)
return ret; return ret;
printk(KERN_INFO "GCT Emergency: Filesystem download success.\n"); dev_info(&usbdev->dev, "GCT Emergency: Filesystem download success.\n");
ret = em_fw_reset(usbdev); ret = em_fw_reset(usbdev);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment