media: au0828: Consolidate dmesg output
authorThomas Gleixner <tglx@linutronix.de>
Tue, 13 Oct 2020 14:26:19 +0000 (16:26 +0200)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Mon, 16 Nov 2020 09:31:10 +0000 (10:31 +0100)
The memory allocations in au0828_init_isoc() happen all in task context
with GFP_KERNEL. Therefore a printk() trying to deduce whether this is
called from task or interrupt context is pretty useless.

Convert it to au0828_isocdbg() as the other one in that function and for
completeness sake add one for the URB allocation as well.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
drivers/media/usb/au0828/au0828-video.c

index 5c4bac5a4ec7600224b86ed23b9d9b69b0e3a577..c0f118563c7d13b44f8cedc963c0b83cbcbf4a37 100644 (file)
@@ -231,6 +231,7 @@ static int au0828_init_isoc(struct au0828_dev *dev, int max_packets,
        for (i = 0; i < dev->isoc_ctl.num_bufs; i++) {
                urb = usb_alloc_urb(max_packets, GFP_KERNEL);
                if (!urb) {
+                       au0828_isocdbg("cannot allocate URB\n");
                        au0828_uninit_isoc(dev);
                        return -ENOMEM;
                }
@@ -239,9 +240,7 @@ static int au0828_init_isoc(struct au0828_dev *dev, int max_packets,
                dev->isoc_ctl.transfer_buffer[i] = usb_alloc_coherent(dev->usbdev,
                        sb_size, GFP_KERNEL, &urb->transfer_dma);
                if (!dev->isoc_ctl.transfer_buffer[i]) {
-                       printk("unable to allocate %i bytes for transfer buffer %i%s\n",
-                                       sb_size, i,
-                                       in_interrupt() ? " while in int" : "");
+                       au0828_isocdbg("cannot allocate transfer buffer\n");
                        au0828_uninit_isoc(dev);
                        return -ENOMEM;
                }