aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/udlfb.c
diff options
context:
space:
mode:
authorPaul Mundt <lethal@linux-sh.org>2011-01-06 04:07:54 -0500
committerPaul Mundt <lethal@linux-sh.org>2011-01-06 04:07:54 -0500
commit81f6f3c1047392a22b9a20bbecf98c7f2d6f922a (patch)
tree1e4b49ff738dcb43f61edaec434d7c9559246beb /drivers/video/udlfb.c
parentb9f03a3cd06c6f8bbecfe08eae2a69cc0a13c690 (diff)
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: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'drivers/video/udlfb.c')
-rw-r--r--drivers/video/udlfb.c76
1 files changed, 39 insertions, 37 deletions
diff --git a/drivers/video/udlfb.c b/drivers/video/udlfb.c
index 530f1598de4e..74a679ef0f5c 100644
--- a/drivers/video/udlfb.c
+++ b/drivers/video/udlfb.c
@@ -16,6 +16,8 @@
16 * from Florian Echtler, Henrik Bjerregaard Pedersen, and others. 16 * from Florian Echtler, Henrik Bjerregaard Pedersen, and others.
17 */ 17 */
18 18
19#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
20
19#include <linux/module.h> 21#include <linux/module.h>
20#include <linux/kernel.h> 22#include <linux/kernel.h>
21#include <linux/init.h> 23#include <linux/init.h>
@@ -291,7 +293,7 @@ static int dlfb_ops_mmap(struct fb_info *info, struct vm_area_struct *vma)
291 293
292 pos = (unsigned long)info->fix.smem_start + offset; 294 pos = (unsigned long)info->fix.smem_start + offset;
293 295
294 dl_notice("mmap() framebuffer addr:%lu size:%lu\n", 296 pr_notice("mmap() framebuffer addr:%lu size:%lu\n",
295 pos, size); 297 pos, size);
296 298
297 while (size > 0) { 299 while (size > 0) {
@@ -732,7 +734,7 @@ static int dlfb_get_edid(struct dlfb_data *dev, char *edid, int len)
732 (0x80 | (0x02 << 5)), i << 8, 0xA1, rbuf, 2, 734 (0x80 | (0x02 << 5)), i << 8, 0xA1, rbuf, 2,
733 HZ); 735 HZ);
734 if (ret < 1) { 736 if (ret < 1) {
735 dl_err("Read EDID byte %d failed err %x\n", i, ret); 737 pr_err("Read EDID byte %d failed err %x\n", i, ret);
736 i--; 738 i--;
737 break; 739 break;
738 } 740 }
@@ -864,7 +866,7 @@ static int dlfb_ops_open(struct fb_info *info, int user)
864 fb_deferred_io_init(info); 866 fb_deferred_io_init(info);
865 } 867 }
866 868
867 dl_notice("open /dev/fb%d user=%d fb_info=%p count=%d\n", 869 pr_notice("open /dev/fb%d user=%d fb_info=%p count=%d\n",
868 info->node, user, info, dev->fb_count); 870 info->node, user, info, dev->fb_count);
869 871
870 return 0; 872 return 0;
@@ -888,7 +890,7 @@ static void dlfb_free(struct kref *kref)
888 890
889 kfree(dev->edid); 891 kfree(dev->edid);
890 892
891 dl_warn("freeing dlfb_data %p\n", dev); 893 pr_warn("freeing dlfb_data %p\n", dev);
892 894
893 kfree(dev); 895 kfree(dev);
894} 896}
@@ -924,7 +926,7 @@ static void dlfb_free_framebuffer_work(struct work_struct *work)
924 /* Assume info structure is freed after this point */ 926 /* Assume info structure is freed after this point */
925 framebuffer_release(info); 927 framebuffer_release(info);
926 928
927 dl_warn("fb_info for /dev/fb%d has been freed\n", node); 929 pr_warn("fb_info for /dev/fb%d has been freed\n", node);
928 930
929 /* ref taken in probe() as part of registering framebfufer */ 931 /* ref taken in probe() as part of registering framebfufer */
930 kref_put(&dev->kref, dlfb_free); 932 kref_put(&dev->kref, dlfb_free);
@@ -950,7 +952,7 @@ static int dlfb_ops_release(struct fb_info *info, int user)
950 info->fbops->fb_mmap = dlfb_ops_mmap; 952 info->fbops->fb_mmap = dlfb_ops_mmap;
951 } 953 }
952 954
953 dl_warn("released /dev/fb%d user=%d count=%d\n", 955 pr_warn("released /dev/fb%d user=%d count=%d\n",
954 info->node, user, dev->fb_count); 956 info->node, user, dev->fb_count);
955 957
956 kref_put(&dev->kref, dlfb_free); 958 kref_put(&dev->kref, dlfb_free);
@@ -968,12 +970,12 @@ static int dlfb_is_valid_mode(struct fb_videomode *mode,
968 struct dlfb_data *dev = info->par; 970 struct dlfb_data *dev = info->par;
969 971
970 if (mode->xres * mode->yres > dev->sku_pixel_limit) { 972 if (mode->xres * mode->yres > dev->sku_pixel_limit) {
971 dl_warn("%dx%d beyond chip capabilities\n", 973 pr_warn("%dx%d beyond chip capabilities\n",
972 mode->xres, mode->yres); 974 mode->xres, mode->yres);
973 return 0; 975 return 0;
974 } 976 }
975 977
976 dl_info("%dx%d valid mode\n", mode->xres, mode->yres); 978 pr_info("%dx%d valid mode\n", mode->xres, mode->yres);
977 979
978 return 1; 980 return 1;
979} 981}
@@ -1017,7 +1019,7 @@ static int dlfb_ops_set_par(struct fb_info *info)
1017 u16 *pix_framebuffer; 1019 u16 *pix_framebuffer;
1018 int i; 1020 int i;
1019 1021
1020 dl_notice("set_par mode %dx%d\n", info->var.xres, info->var.yres); 1022 pr_notice("set_par mode %dx%d\n", info->var.xres, info->var.yres);
1021 1023
1022 result = dlfb_set_video_mode(dev, &info->var); 1024 result = dlfb_set_video_mode(dev, &info->var);
1023 1025
@@ -1096,7 +1098,7 @@ static int dlfb_realloc_framebuffer(struct dlfb_data *dev, struct fb_info *info)
1096 unsigned char *new_fb; 1098 unsigned char *new_fb;
1097 unsigned char *new_back; 1099 unsigned char *new_back;
1098 1100
1099 dl_warn("Reallocating framebuffer. Addresses will change!\n"); 1101 pr_warn("Reallocating framebuffer. Addresses will change!\n");
1100 1102
1101 new_len = info->fix.line_length * info->var.yres; 1103 new_len = info->fix.line_length * info->var.yres;
1102 1104
@@ -1106,7 +1108,7 @@ static int dlfb_realloc_framebuffer(struct dlfb_data *dev, struct fb_info *info)
1106 */ 1108 */
1107 new_fb = vmalloc(new_len); 1109 new_fb = vmalloc(new_len);
1108 if (!new_fb) { 1110 if (!new_fb) {
1109 dl_err("Virtual framebuffer alloc failed\n"); 1111 pr_err("Virtual framebuffer alloc failed\n");
1110 goto error; 1112 goto error;
1111 } 1113 }
1112 1114
@@ -1128,7 +1130,7 @@ static int dlfb_realloc_framebuffer(struct dlfb_data *dev, struct fb_info *info)
1128 */ 1130 */
1129 new_back = vmalloc(new_len); 1131 new_back = vmalloc(new_len);
1130 if (!new_back) 1132 if (!new_back)
1131 dl_info("No shadow/backing buffer allcoated\n"); 1133 pr_info("No shadow/backing buffer allcoated\n");
1132 else { 1134 else {
1133 if (dev->backing_buffer) 1135 if (dev->backing_buffer)
1134 vfree(dev->backing_buffer); 1136 vfree(dev->backing_buffer);
@@ -1201,12 +1203,12 @@ static int dlfb_setup_modes(struct dlfb_data *dev,
1201 /* If that fails, use a previously returned EDID if available */ 1203 /* If that fails, use a previously returned EDID if available */
1202 if (info->monspecs.modedb_len == 0) { 1204 if (info->monspecs.modedb_len == 0) {
1203 1205
1204 dl_err("Unable to get valid EDID from device/display\n"); 1206 pr_err("Unable to get valid EDID from device/display\n");
1205 1207
1206 if (dev->edid) { 1208 if (dev->edid) {
1207 fb_edid_to_monspecs(dev->edid, &info->monspecs); 1209 fb_edid_to_monspecs(dev->edid, &info->monspecs);
1208 if (info->monspecs.modedb_len > 0) 1210 if (info->monspecs.modedb_len > 0)
1209 dl_err("Using previously queried EDID\n"); 1211 pr_err("Using previously queried EDID\n");
1210 } 1212 }
1211 } 1213 }
1212 1214
@@ -1218,7 +1220,7 @@ static int dlfb_setup_modes(struct dlfb_data *dev,
1218 memcpy(edid, default_edid, default_edid_size); 1220 memcpy(edid, default_edid, default_edid_size);
1219 dev->edid = edid; 1221 dev->edid = edid;
1220 dev->edid_size = default_edid_size; 1222 dev->edid_size = default_edid_size;
1221 dl_err("Using default/backup EDID\n"); 1223 pr_err("Using default/backup EDID\n");
1222 } 1224 }
1223 } 1225 }
1224 } 1226 }
@@ -1344,7 +1346,7 @@ static ssize_t edid_show(
1344 if (off + count > dev->edid_size) 1346 if (off + count > dev->edid_size)
1345 count = dev->edid_size - off; 1347 count = dev->edid_size - off;
1346 1348
1347 dl_info("sysfs edid copy %p to %p, %d bytes\n", 1349 pr_info("sysfs edid copy %p to %p, %d bytes\n",
1348 dev->edid, buf, (int) count); 1350 dev->edid, buf, (int) count);
1349 1351
1350 memcpy(buf, dev->edid, count); 1352 memcpy(buf, dev->edid, count);
@@ -1367,7 +1369,7 @@ static ssize_t edid_store(
1367 dlfb_setup_modes(dev, fb_info, src, src_size); 1369 dlfb_setup_modes(dev, fb_info, src, src_size);
1368 1370
1369 if (dev->edid && (memcmp(src, dev->edid, src_size) == 0)) { 1371 if (dev->edid && (memcmp(src, dev->edid, src_size) == 0)) {
1370 dl_info("sysfs written EDID is new default\n"); 1372 pr_info("sysfs written EDID is new default\n");
1371 dlfb_ops_set_par(fb_info); 1373 dlfb_ops_set_par(fb_info);
1372 return src_size; 1374 return src_size;
1373 } else 1375 } else
@@ -1440,7 +1442,7 @@ static int dlfb_parse_vendor_descriptor(struct dlfb_data *dev,
1440 total_len = usb_get_descriptor(usbdev, 0x5f, /* vendor specific */ 1442 total_len = usb_get_descriptor(usbdev, 0x5f, /* vendor specific */
1441 0, desc, MAX_VENDOR_DESCRIPTOR_SIZE); 1443 0, desc, MAX_VENDOR_DESCRIPTOR_SIZE);
1442 if (total_len > 5) { 1444 if (total_len > 5) {
1443 dl_info("vendor descriptor length:%x data:%02x %02x %02x %02x" \ 1445 pr_info("vendor descriptor length:%x data:%02x %02x %02x %02x" \
1444 "%02x %02x %02x %02x %02x %02x %02x\n", 1446 "%02x %02x %02x %02x %02x %02x %02x\n",
1445 total_len, desc[0], 1447 total_len, desc[0],
1446 desc[1], desc[2], desc[3], desc[4], desc[5], desc[6], 1448 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 case 0x0200: { /* max_area */ 1471 case 0x0200: { /* max_area */
1470 u32 max_area; 1472 u32 max_area;
1471 max_area = le32_to_cpu(*((u32 *)desc)); 1473 max_area = le32_to_cpu(*((u32 *)desc));
1472 dl_warn("DL chip limited to %d pixel modes\n", 1474 pr_warn("DL chip limited to %d pixel modes\n",
1473 max_area); 1475 max_area);
1474 dev->sku_pixel_limit = max_area; 1476 dev->sku_pixel_limit = max_area;
1475 break; 1477 break;
@@ -1485,7 +1487,7 @@ static int dlfb_parse_vendor_descriptor(struct dlfb_data *dev,
1485 1487
1486unrecognized: 1488unrecognized:
1487 /* allow udlfb to load for now even if firmware unrecognized */ 1489 /* allow udlfb to load for now even if firmware unrecognized */
1488 dl_err("Unrecognized vendor firmware descriptor\n"); 1490 pr_err("Unrecognized vendor firmware descriptor\n");
1489 1491
1490success: 1492success:
1491 kfree(buf); 1493 kfree(buf);
@@ -1518,24 +1520,24 @@ static int dlfb_usb_probe(struct usb_interface *interface,
1518 dev->gdev = &usbdev->dev; /* our generic struct device * */ 1520 dev->gdev = &usbdev->dev; /* our generic struct device * */
1519 usb_set_intfdata(interface, dev); 1521 usb_set_intfdata(interface, dev);
1520 1522
1521 dl_info("%s %s - serial #%s\n", 1523 pr_info("%s %s - serial #%s\n",
1522 usbdev->manufacturer, usbdev->product, usbdev->serial); 1524 usbdev->manufacturer, usbdev->product, usbdev->serial);
1523 dl_info("vid_%04x&pid_%04x&rev_%04x driver's dlfb_data struct at %p\n", 1525 pr_info("vid_%04x&pid_%04x&rev_%04x driver's dlfb_data struct at %p\n",
1524 usbdev->descriptor.idVendor, usbdev->descriptor.idProduct, 1526 usbdev->descriptor.idVendor, usbdev->descriptor.idProduct,
1525 usbdev->descriptor.bcdDevice, dev); 1527 usbdev->descriptor.bcdDevice, dev);
1526 dl_info("console enable=%d\n", console); 1528 pr_info("console enable=%d\n", console);
1527 dl_info("fb_defio enable=%d\n", fb_defio); 1529 pr_info("fb_defio enable=%d\n", fb_defio);
1528 1530
1529 dev->sku_pixel_limit = 2048 * 1152; /* default to maximum */ 1531 dev->sku_pixel_limit = 2048 * 1152; /* default to maximum */
1530 1532
1531 if (!dlfb_parse_vendor_descriptor(dev, usbdev)) { 1533 if (!dlfb_parse_vendor_descriptor(dev, usbdev)) {
1532 dl_err("firmware not recognized. Assume incompatible device\n"); 1534 pr_err("firmware not recognized. Assume incompatible device\n");
1533 goto error; 1535 goto error;
1534 } 1536 }
1535 1537
1536 if (!dlfb_alloc_urb_list(dev, WRITES_IN_FLIGHT, MAX_TRANSFER)) { 1538 if (!dlfb_alloc_urb_list(dev, WRITES_IN_FLIGHT, MAX_TRANSFER)) {
1537 retval = -ENOMEM; 1539 retval = -ENOMEM;
1538 dl_err("dlfb_alloc_urb_list failed\n"); 1540 pr_err("dlfb_alloc_urb_list failed\n");
1539 goto error; 1541 goto error;
1540 } 1542 }
1541 1543
@@ -1545,7 +1547,7 @@ static int dlfb_usb_probe(struct usb_interface *interface,
1545 info = framebuffer_alloc(0, &usbdev->dev); 1547 info = framebuffer_alloc(0, &usbdev->dev);
1546 if (!info) { 1548 if (!info) {
1547 retval = -ENOMEM; 1549 retval = -ENOMEM;
1548 dl_err("framebuffer_alloc failed\n"); 1550 pr_err("framebuffer_alloc failed\n");
1549 goto error; 1551 goto error;
1550 } 1552 }
1551 1553
@@ -1556,7 +1558,7 @@ static int dlfb_usb_probe(struct usb_interface *interface,
1556 1558
1557 retval = fb_alloc_cmap(&info->cmap, 256, 0); 1559 retval = fb_alloc_cmap(&info->cmap, 256, 0);
1558 if (retval < 0) { 1560 if (retval < 0) {
1559 dl_err("fb_alloc_cmap failed %x\n", retval); 1561 pr_err("fb_alloc_cmap failed %x\n", retval);
1560 goto error; 1562 goto error;
1561 } 1563 }
1562 1564
@@ -1567,7 +1569,7 @@ static int dlfb_usb_probe(struct usb_interface *interface,
1567 1569
1568 retval = dlfb_setup_modes(dev, info, NULL, 0); 1570 retval = dlfb_setup_modes(dev, info, NULL, 0);
1569 if (retval != 0) { 1571 if (retval != 0) {
1570 dl_err("unable to find common mode for display and adapter\n"); 1572 pr_err("unable to find common mode for display and adapter\n");
1571 goto error; 1573 goto error;
1572 } 1574 }
1573 1575
@@ -1581,7 +1583,7 @@ static int dlfb_usb_probe(struct usb_interface *interface,
1581 1583
1582 retval = register_framebuffer(info); 1584 retval = register_framebuffer(info);
1583 if (retval < 0) { 1585 if (retval < 0) {
1584 dl_err("register_framebuffer failed %d\n", retval); 1586 pr_err("register_framebuffer failed %d\n", retval);
1585 goto error; 1587 goto error;
1586 } 1588 }
1587 1589
@@ -1590,7 +1592,7 @@ static int dlfb_usb_probe(struct usb_interface *interface,
1590 1592
1591 device_create_bin_file(info->dev, &edid_attr); 1593 device_create_bin_file(info->dev, &edid_attr);
1592 1594
1593 dl_info("DisplayLink USB device /dev/fb%d attached. %dx%d resolution." 1595 pr_info("DisplayLink USB device /dev/fb%d attached. %dx%d resolution."
1594 " Using %dK framebuffer memory\n", info->node, 1596 " Using %dK framebuffer memory\n", info->node,
1595 info->var.xres, info->var.yres, 1597 info->var.xres, info->var.yres,
1596 ((dev->backing_buffer) ? 1598 ((dev->backing_buffer) ?
@@ -1634,7 +1636,7 @@ static void dlfb_usb_disconnect(struct usb_interface *interface)
1634 dev = usb_get_intfdata(interface); 1636 dev = usb_get_intfdata(interface);
1635 info = dev->info; 1637 info = dev->info;
1636 1638
1637 dl_info("USB disconnect starting\n"); 1639 pr_info("USB disconnect starting\n");
1638 1640
1639 /* we virtualize until all fb clients release. Then we free */ 1641 /* we virtualize until all fb clients release. Then we free */
1640 dev->virtualized = true; 1642 dev->virtualized = true;
@@ -1698,7 +1700,7 @@ static void dlfb_urb_completion(struct urb *urb)
1698 if (!(urb->status == -ENOENT || 1700 if (!(urb->status == -ENOENT ||
1699 urb->status == -ECONNRESET || 1701 urb->status == -ECONNRESET ||
1700 urb->status == -ESHUTDOWN)) { 1702 urb->status == -ESHUTDOWN)) {
1701 dl_err("%s - nonzero write bulk status received: %d\n", 1703 pr_err("%s - nonzero write bulk status received: %d\n",
1702 __func__, urb->status); 1704 __func__, urb->status);
1703 atomic_set(&dev->lost_pixels, 1); 1705 atomic_set(&dev->lost_pixels, 1);
1704 } 1706 }
@@ -1730,7 +1732,7 @@ static void dlfb_free_urb_list(struct dlfb_data *dev)
1730 int ret; 1732 int ret;
1731 unsigned long flags; 1733 unsigned long flags;
1732 1734
1733 dl_notice("Waiting for completes and freeing all render urbs\n"); 1735 pr_notice("Waiting for completes and freeing all render urbs\n");
1734 1736
1735 /* keep waiting and freeing, until we've got 'em all */ 1737 /* keep waiting and freeing, until we've got 'em all */
1736 while (count--) { 1738 while (count--) {
@@ -1809,7 +1811,7 @@ static int dlfb_alloc_urb_list(struct dlfb_data *dev, int count, size_t size)
1809 dev->urbs.count = i; 1811 dev->urbs.count = i;
1810 dev->urbs.available = i; 1812 dev->urbs.available = i;
1811 1813
1812 dl_notice("allocated %d %d byte urbs\n", i, (int) size); 1814 pr_notice("allocated %d %d byte urbs\n", i, (int) size);
1813 1815
1814 return i; 1816 return i;
1815} 1817}
@@ -1826,7 +1828,7 @@ static struct urb *dlfb_get_urb(struct dlfb_data *dev)
1826 ret = down_timeout(&dev->urbs.limit_sem, GET_URB_TIMEOUT); 1828 ret = down_timeout(&dev->urbs.limit_sem, GET_URB_TIMEOUT);
1827 if (ret) { 1829 if (ret) {
1828 atomic_set(&dev->lost_pixels, 1); 1830 atomic_set(&dev->lost_pixels, 1);
1829 dl_warn("wait for urb interrupted: %x available: %d\n", 1831 pr_warn("wait for urb interrupted: %x available: %d\n",
1830 ret, dev->urbs.available); 1832 ret, dev->urbs.available);
1831 goto error; 1833 goto error;
1832 } 1834 }
@@ -1858,7 +1860,7 @@ static int dlfb_submit_urb(struct dlfb_data *dev, struct urb *urb, size_t len)
1858 if (ret) { 1860 if (ret) {
1859 dlfb_urb_completion(urb); /* because no one else will */ 1861 dlfb_urb_completion(urb); /* because no one else will */
1860 atomic_set(&dev->lost_pixels, 1); 1862 atomic_set(&dev->lost_pixels, 1);
1861 dl_err("usb_submit_urb error %x\n", ret); 1863 pr_err("usb_submit_urb error %x\n", ret);
1862 } 1864 }
1863 return ret; 1865 return ret;
1864} 1866}