提交 81f6f3c1 编写于 作者: P Paul Mundt

video: udlfb: Kill off special printk wrappers, use pr_fmt().

This kills off all of the dl_xxx() printk wrappers and simply stubs in a
pr_fmt() definition to accomplish the same thing.
Signed-off-by: NPaul Mundt <lethal@linux-sh.org>
上级 b9f03a3c
...@@ -16,6 +16,8 @@ ...@@ -16,6 +16,8 @@
* from Florian Echtler, Henrik Bjerregaard Pedersen, and others. * from Florian Echtler, Henrik Bjerregaard Pedersen, and others.
*/ */
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/module.h> #include <linux/module.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/init.h> #include <linux/init.h>
...@@ -291,7 +293,7 @@ static int dlfb_ops_mmap(struct fb_info *info, struct vm_area_struct *vma) ...@@ -291,7 +293,7 @@ static int dlfb_ops_mmap(struct fb_info *info, struct vm_area_struct *vma)
pos = (unsigned long)info->fix.smem_start + offset; pos = (unsigned long)info->fix.smem_start + offset;
dl_notice("mmap() framebuffer addr:%lu size:%lu\n", pr_notice("mmap() framebuffer addr:%lu size:%lu\n",
pos, size); pos, size);
while (size > 0) { while (size > 0) {
...@@ -732,7 +734,7 @@ static int dlfb_get_edid(struct dlfb_data *dev, char *edid, int len) ...@@ -732,7 +734,7 @@ static int dlfb_get_edid(struct dlfb_data *dev, char *edid, int len)
(0x80 | (0x02 << 5)), i << 8, 0xA1, rbuf, 2, (0x80 | (0x02 << 5)), i << 8, 0xA1, rbuf, 2,
HZ); HZ);
if (ret < 1) { if (ret < 1) {
dl_err("Read EDID byte %d failed err %x\n", i, ret); pr_err("Read EDID byte %d failed err %x\n", i, ret);
i--; i--;
break; break;
} }
...@@ -864,7 +866,7 @@ static int dlfb_ops_open(struct fb_info *info, int user) ...@@ -864,7 +866,7 @@ static int dlfb_ops_open(struct fb_info *info, int user)
fb_deferred_io_init(info); fb_deferred_io_init(info);
} }
dl_notice("open /dev/fb%d user=%d fb_info=%p count=%d\n", pr_notice("open /dev/fb%d user=%d fb_info=%p count=%d\n",
info->node, user, info, dev->fb_count); info->node, user, info, dev->fb_count);
return 0; return 0;
...@@ -888,7 +890,7 @@ static void dlfb_free(struct kref *kref) ...@@ -888,7 +890,7 @@ static void dlfb_free(struct kref *kref)
kfree(dev->edid); kfree(dev->edid);
dl_warn("freeing dlfb_data %p\n", dev); pr_warn("freeing dlfb_data %p\n", dev);
kfree(dev); kfree(dev);
} }
...@@ -924,7 +926,7 @@ static void dlfb_free_framebuffer_work(struct work_struct *work) ...@@ -924,7 +926,7 @@ static void dlfb_free_framebuffer_work(struct work_struct *work)
/* Assume info structure is freed after this point */ /* Assume info structure is freed after this point */
framebuffer_release(info); framebuffer_release(info);
dl_warn("fb_info for /dev/fb%d has been freed\n", node); pr_warn("fb_info for /dev/fb%d has been freed\n", node);
/* ref taken in probe() as part of registering framebfufer */ /* ref taken in probe() as part of registering framebfufer */
kref_put(&dev->kref, dlfb_free); kref_put(&dev->kref, dlfb_free);
...@@ -950,7 +952,7 @@ static int dlfb_ops_release(struct fb_info *info, int user) ...@@ -950,7 +952,7 @@ static int dlfb_ops_release(struct fb_info *info, int user)
info->fbops->fb_mmap = dlfb_ops_mmap; info->fbops->fb_mmap = dlfb_ops_mmap;
} }
dl_warn("released /dev/fb%d user=%d count=%d\n", pr_warn("released /dev/fb%d user=%d count=%d\n",
info->node, user, dev->fb_count); info->node, user, dev->fb_count);
kref_put(&dev->kref, dlfb_free); kref_put(&dev->kref, dlfb_free);
...@@ -968,12 +970,12 @@ static int dlfb_is_valid_mode(struct fb_videomode *mode, ...@@ -968,12 +970,12 @@ static int dlfb_is_valid_mode(struct fb_videomode *mode,
struct dlfb_data *dev = info->par; struct dlfb_data *dev = info->par;
if (mode->xres * mode->yres > dev->sku_pixel_limit) { if (mode->xres * mode->yres > dev->sku_pixel_limit) {
dl_warn("%dx%d beyond chip capabilities\n", pr_warn("%dx%d beyond chip capabilities\n",
mode->xres, mode->yres); mode->xres, mode->yres);
return 0; return 0;
} }
dl_info("%dx%d valid mode\n", mode->xres, mode->yres); pr_info("%dx%d valid mode\n", mode->xres, mode->yres);
return 1; return 1;
} }
...@@ -1017,7 +1019,7 @@ static int dlfb_ops_set_par(struct fb_info *info) ...@@ -1017,7 +1019,7 @@ static int dlfb_ops_set_par(struct fb_info *info)
u16 *pix_framebuffer; u16 *pix_framebuffer;
int i; int i;
dl_notice("set_par mode %dx%d\n", info->var.xres, info->var.yres); pr_notice("set_par mode %dx%d\n", info->var.xres, info->var.yres);
result = dlfb_set_video_mode(dev, &info->var); result = dlfb_set_video_mode(dev, &info->var);
...@@ -1096,7 +1098,7 @@ static int dlfb_realloc_framebuffer(struct dlfb_data *dev, struct fb_info *info) ...@@ -1096,7 +1098,7 @@ static int dlfb_realloc_framebuffer(struct dlfb_data *dev, struct fb_info *info)
unsigned char *new_fb; unsigned char *new_fb;
unsigned char *new_back; unsigned char *new_back;
dl_warn("Reallocating framebuffer. Addresses will change!\n"); pr_warn("Reallocating framebuffer. Addresses will change!\n");
new_len = info->fix.line_length * info->var.yres; new_len = info->fix.line_length * info->var.yres;
...@@ -1106,7 +1108,7 @@ static int dlfb_realloc_framebuffer(struct dlfb_data *dev, struct fb_info *info) ...@@ -1106,7 +1108,7 @@ static int dlfb_realloc_framebuffer(struct dlfb_data *dev, struct fb_info *info)
*/ */
new_fb = vmalloc(new_len); new_fb = vmalloc(new_len);
if (!new_fb) { if (!new_fb) {
dl_err("Virtual framebuffer alloc failed\n"); pr_err("Virtual framebuffer alloc failed\n");
goto error; goto error;
} }
...@@ -1128,7 +1130,7 @@ static int dlfb_realloc_framebuffer(struct dlfb_data *dev, struct fb_info *info) ...@@ -1128,7 +1130,7 @@ static int dlfb_realloc_framebuffer(struct dlfb_data *dev, struct fb_info *info)
*/ */
new_back = vmalloc(new_len); new_back = vmalloc(new_len);
if (!new_back) if (!new_back)
dl_info("No shadow/backing buffer allcoated\n"); pr_info("No shadow/backing buffer allcoated\n");
else { else {
if (dev->backing_buffer) if (dev->backing_buffer)
vfree(dev->backing_buffer); vfree(dev->backing_buffer);
...@@ -1201,12 +1203,12 @@ static int dlfb_setup_modes(struct dlfb_data *dev, ...@@ -1201,12 +1203,12 @@ static int dlfb_setup_modes(struct dlfb_data *dev,
/* If that fails, use a previously returned EDID if available */ /* If that fails, use a previously returned EDID if available */
if (info->monspecs.modedb_len == 0) { if (info->monspecs.modedb_len == 0) {
dl_err("Unable to get valid EDID from device/display\n"); pr_err("Unable to get valid EDID from device/display\n");
if (dev->edid) { if (dev->edid) {
fb_edid_to_monspecs(dev->edid, &info->monspecs); fb_edid_to_monspecs(dev->edid, &info->monspecs);
if (info->monspecs.modedb_len > 0) if (info->monspecs.modedb_len > 0)
dl_err("Using previously queried EDID\n"); pr_err("Using previously queried EDID\n");
} }
} }
...@@ -1218,7 +1220,7 @@ static int dlfb_setup_modes(struct dlfb_data *dev, ...@@ -1218,7 +1220,7 @@ static int dlfb_setup_modes(struct dlfb_data *dev,
memcpy(edid, default_edid, default_edid_size); memcpy(edid, default_edid, default_edid_size);
dev->edid = edid; dev->edid = edid;
dev->edid_size = default_edid_size; dev->edid_size = default_edid_size;
dl_err("Using default/backup EDID\n"); pr_err("Using default/backup EDID\n");
} }
} }
} }
...@@ -1344,7 +1346,7 @@ static ssize_t edid_show( ...@@ -1344,7 +1346,7 @@ static ssize_t edid_show(
if (off + count > dev->edid_size) if (off + count > dev->edid_size)
count = dev->edid_size - off; count = dev->edid_size - off;
dl_info("sysfs edid copy %p to %p, %d bytes\n", pr_info("sysfs edid copy %p to %p, %d bytes\n",
dev->edid, buf, (int) count); dev->edid, buf, (int) count);
memcpy(buf, dev->edid, count); memcpy(buf, dev->edid, count);
...@@ -1367,7 +1369,7 @@ static ssize_t edid_store( ...@@ -1367,7 +1369,7 @@ static ssize_t edid_store(
dlfb_setup_modes(dev, fb_info, src, src_size); dlfb_setup_modes(dev, fb_info, src, src_size);
if (dev->edid && (memcmp(src, dev->edid, src_size) == 0)) { if (dev->edid && (memcmp(src, dev->edid, src_size) == 0)) {
dl_info("sysfs written EDID is new default\n"); pr_info("sysfs written EDID is new default\n");
dlfb_ops_set_par(fb_info); dlfb_ops_set_par(fb_info);
return src_size; return src_size;
} else } else
...@@ -1440,7 +1442,7 @@ static int dlfb_parse_vendor_descriptor(struct dlfb_data *dev, ...@@ -1440,7 +1442,7 @@ static int dlfb_parse_vendor_descriptor(struct dlfb_data *dev,
total_len = usb_get_descriptor(usbdev, 0x5f, /* vendor specific */ total_len = usb_get_descriptor(usbdev, 0x5f, /* vendor specific */
0, desc, MAX_VENDOR_DESCRIPTOR_SIZE); 0, desc, MAX_VENDOR_DESCRIPTOR_SIZE);
if (total_len > 5) { if (total_len > 5) {
dl_info("vendor descriptor length:%x data:%02x %02x %02x %02x" \ pr_info("vendor descriptor length:%x data:%02x %02x %02x %02x" \
"%02x %02x %02x %02x %02x %02x %02x\n", "%02x %02x %02x %02x %02x %02x %02x\n",
total_len, desc[0], total_len, desc[0],
desc[1], desc[2], desc[3], desc[4], desc[5], desc[6], desc[1], desc[2], desc[3], desc[4], desc[5], desc[6],
...@@ -1469,7 +1471,7 @@ static int dlfb_parse_vendor_descriptor(struct dlfb_data *dev, ...@@ -1469,7 +1471,7 @@ static int dlfb_parse_vendor_descriptor(struct dlfb_data *dev,
case 0x0200: { /* max_area */ case 0x0200: { /* max_area */
u32 max_area; u32 max_area;
max_area = le32_to_cpu(*((u32 *)desc)); max_area = le32_to_cpu(*((u32 *)desc));
dl_warn("DL chip limited to %d pixel modes\n", pr_warn("DL chip limited to %d pixel modes\n",
max_area); max_area);
dev->sku_pixel_limit = max_area; dev->sku_pixel_limit = max_area;
break; break;
...@@ -1485,7 +1487,7 @@ static int dlfb_parse_vendor_descriptor(struct dlfb_data *dev, ...@@ -1485,7 +1487,7 @@ static int dlfb_parse_vendor_descriptor(struct dlfb_data *dev,
unrecognized: unrecognized:
/* allow udlfb to load for now even if firmware unrecognized */ /* allow udlfb to load for now even if firmware unrecognized */
dl_err("Unrecognized vendor firmware descriptor\n"); pr_err("Unrecognized vendor firmware descriptor\n");
success: success:
kfree(buf); kfree(buf);
...@@ -1518,24 +1520,24 @@ static int dlfb_usb_probe(struct usb_interface *interface, ...@@ -1518,24 +1520,24 @@ static int dlfb_usb_probe(struct usb_interface *interface,
dev->gdev = &usbdev->dev; /* our generic struct device * */ dev->gdev = &usbdev->dev; /* our generic struct device * */
usb_set_intfdata(interface, dev); usb_set_intfdata(interface, dev);
dl_info("%s %s - serial #%s\n", pr_info("%s %s - serial #%s\n",
usbdev->manufacturer, usbdev->product, usbdev->serial); usbdev->manufacturer, usbdev->product, usbdev->serial);
dl_info("vid_%04x&pid_%04x&rev_%04x driver's dlfb_data struct at %p\n", pr_info("vid_%04x&pid_%04x&rev_%04x driver's dlfb_data struct at %p\n",
usbdev->descriptor.idVendor, usbdev->descriptor.idProduct, usbdev->descriptor.idVendor, usbdev->descriptor.idProduct,
usbdev->descriptor.bcdDevice, dev); usbdev->descriptor.bcdDevice, dev);
dl_info("console enable=%d\n", console); pr_info("console enable=%d\n", console);
dl_info("fb_defio enable=%d\n", fb_defio); pr_info("fb_defio enable=%d\n", fb_defio);
dev->sku_pixel_limit = 2048 * 1152; /* default to maximum */ dev->sku_pixel_limit = 2048 * 1152; /* default to maximum */
if (!dlfb_parse_vendor_descriptor(dev, usbdev)) { if (!dlfb_parse_vendor_descriptor(dev, usbdev)) {
dl_err("firmware not recognized. Assume incompatible device\n"); pr_err("firmware not recognized. Assume incompatible device\n");
goto error; goto error;
} }
if (!dlfb_alloc_urb_list(dev, WRITES_IN_FLIGHT, MAX_TRANSFER)) { if (!dlfb_alloc_urb_list(dev, WRITES_IN_FLIGHT, MAX_TRANSFER)) {
retval = -ENOMEM; retval = -ENOMEM;
dl_err("dlfb_alloc_urb_list failed\n"); pr_err("dlfb_alloc_urb_list failed\n");
goto error; goto error;
} }
...@@ -1545,7 +1547,7 @@ static int dlfb_usb_probe(struct usb_interface *interface, ...@@ -1545,7 +1547,7 @@ static int dlfb_usb_probe(struct usb_interface *interface,
info = framebuffer_alloc(0, &usbdev->dev); info = framebuffer_alloc(0, &usbdev->dev);
if (!info) { if (!info) {
retval = -ENOMEM; retval = -ENOMEM;
dl_err("framebuffer_alloc failed\n"); pr_err("framebuffer_alloc failed\n");
goto error; goto error;
} }
...@@ -1556,7 +1558,7 @@ static int dlfb_usb_probe(struct usb_interface *interface, ...@@ -1556,7 +1558,7 @@ static int dlfb_usb_probe(struct usb_interface *interface,
retval = fb_alloc_cmap(&info->cmap, 256, 0); retval = fb_alloc_cmap(&info->cmap, 256, 0);
if (retval < 0) { if (retval < 0) {
dl_err("fb_alloc_cmap failed %x\n", retval); pr_err("fb_alloc_cmap failed %x\n", retval);
goto error; goto error;
} }
...@@ -1567,7 +1569,7 @@ static int dlfb_usb_probe(struct usb_interface *interface, ...@@ -1567,7 +1569,7 @@ static int dlfb_usb_probe(struct usb_interface *interface,
retval = dlfb_setup_modes(dev, info, NULL, 0); retval = dlfb_setup_modes(dev, info, NULL, 0);
if (retval != 0) { if (retval != 0) {
dl_err("unable to find common mode for display and adapter\n"); pr_err("unable to find common mode for display and adapter\n");
goto error; goto error;
} }
...@@ -1581,7 +1583,7 @@ static int dlfb_usb_probe(struct usb_interface *interface, ...@@ -1581,7 +1583,7 @@ static int dlfb_usb_probe(struct usb_interface *interface,
retval = register_framebuffer(info); retval = register_framebuffer(info);
if (retval < 0) { if (retval < 0) {
dl_err("register_framebuffer failed %d\n", retval); pr_err("register_framebuffer failed %d\n", retval);
goto error; goto error;
} }
...@@ -1590,7 +1592,7 @@ static int dlfb_usb_probe(struct usb_interface *interface, ...@@ -1590,7 +1592,7 @@ static int dlfb_usb_probe(struct usb_interface *interface,
device_create_bin_file(info->dev, &edid_attr); device_create_bin_file(info->dev, &edid_attr);
dl_info("DisplayLink USB device /dev/fb%d attached. %dx%d resolution." pr_info("DisplayLink USB device /dev/fb%d attached. %dx%d resolution."
" Using %dK framebuffer memory\n", info->node, " Using %dK framebuffer memory\n", info->node,
info->var.xres, info->var.yres, info->var.xres, info->var.yres,
((dev->backing_buffer) ? ((dev->backing_buffer) ?
...@@ -1634,7 +1636,7 @@ static void dlfb_usb_disconnect(struct usb_interface *interface) ...@@ -1634,7 +1636,7 @@ static void dlfb_usb_disconnect(struct usb_interface *interface)
dev = usb_get_intfdata(interface); dev = usb_get_intfdata(interface);
info = dev->info; info = dev->info;
dl_info("USB disconnect starting\n"); pr_info("USB disconnect starting\n");
/* we virtualize until all fb clients release. Then we free */ /* we virtualize until all fb clients release. Then we free */
dev->virtualized = true; dev->virtualized = true;
...@@ -1698,7 +1700,7 @@ static void dlfb_urb_completion(struct urb *urb) ...@@ -1698,7 +1700,7 @@ static void dlfb_urb_completion(struct urb *urb)
if (!(urb->status == -ENOENT || if (!(urb->status == -ENOENT ||
urb->status == -ECONNRESET || urb->status == -ECONNRESET ||
urb->status == -ESHUTDOWN)) { urb->status == -ESHUTDOWN)) {
dl_err("%s - nonzero write bulk status received: %d\n", pr_err("%s - nonzero write bulk status received: %d\n",
__func__, urb->status); __func__, urb->status);
atomic_set(&dev->lost_pixels, 1); atomic_set(&dev->lost_pixels, 1);
} }
...@@ -1730,7 +1732,7 @@ static void dlfb_free_urb_list(struct dlfb_data *dev) ...@@ -1730,7 +1732,7 @@ static void dlfb_free_urb_list(struct dlfb_data *dev)
int ret; int ret;
unsigned long flags; unsigned long flags;
dl_notice("Waiting for completes and freeing all render urbs\n"); pr_notice("Waiting for completes and freeing all render urbs\n");
/* keep waiting and freeing, until we've got 'em all */ /* keep waiting and freeing, until we've got 'em all */
while (count--) { while (count--) {
...@@ -1809,7 +1811,7 @@ static int dlfb_alloc_urb_list(struct dlfb_data *dev, int count, size_t size) ...@@ -1809,7 +1811,7 @@ static int dlfb_alloc_urb_list(struct dlfb_data *dev, int count, size_t size)
dev->urbs.count = i; dev->urbs.count = i;
dev->urbs.available = i; dev->urbs.available = i;
dl_notice("allocated %d %d byte urbs\n", i, (int) size); pr_notice("allocated %d %d byte urbs\n", i, (int) size);
return i; return i;
} }
...@@ -1826,7 +1828,7 @@ static struct urb *dlfb_get_urb(struct dlfb_data *dev) ...@@ -1826,7 +1828,7 @@ static struct urb *dlfb_get_urb(struct dlfb_data *dev)
ret = down_timeout(&dev->urbs.limit_sem, GET_URB_TIMEOUT); ret = down_timeout(&dev->urbs.limit_sem, GET_URB_TIMEOUT);
if (ret) { if (ret) {
atomic_set(&dev->lost_pixels, 1); atomic_set(&dev->lost_pixels, 1);
dl_warn("wait for urb interrupted: %x available: %d\n", pr_warn("wait for urb interrupted: %x available: %d\n",
ret, dev->urbs.available); ret, dev->urbs.available);
goto error; goto error;
} }
...@@ -1858,7 +1860,7 @@ static int dlfb_submit_urb(struct dlfb_data *dev, struct urb *urb, size_t len) ...@@ -1858,7 +1860,7 @@ static int dlfb_submit_urb(struct dlfb_data *dev, struct urb *urb, size_t len)
if (ret) { if (ret) {
dlfb_urb_completion(urb); /* because no one else will */ dlfb_urb_completion(urb); /* because no one else will */
atomic_set(&dev->lost_pixels, 1); atomic_set(&dev->lost_pixels, 1);
dl_err("usb_submit_urb error %x\n", ret); pr_err("usb_submit_urb error %x\n", ret);
} }
return ret; return ret;
} }
......
...@@ -92,20 +92,4 @@ struct dlfb_data { ...@@ -92,20 +92,4 @@ struct dlfb_data {
#define DL_ALIGN_UP(x, a) ALIGN(x, a) #define DL_ALIGN_UP(x, a) ALIGN(x, a)
#define DL_ALIGN_DOWN(x, a) ALIGN(x-(a-1), a) #define DL_ALIGN_DOWN(x, a) ALIGN(x-(a-1), a)
/*
* udlfb is both a usb device, and a framebuffer device.
* They may exist at the same time, but during various stages
* inactivity, teardown, or "virtual" operation, only one or the
* other will exist (one will outlive the other). So we can't
* call the dev_*() macros, because we don't have a stable dev object.
*/
#define dl_err(format, arg...) \
pr_err("udlfb: " format, ## arg)
#define dl_warn(format, arg...) \
pr_warning("udlfb: " format, ## arg)
#define dl_notice(format, arg...) \
pr_notice("udlfb: " format, ## arg)
#define dl_info(format, arg...) \
pr_info("udlfb: " format, ## arg)
#endif #endif
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册