diff options
author | Thierry Reding <treding@nvidia.com> | 2015-08-12 10:32:06 -0400 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2015-08-12 11:11:58 -0400 |
commit | 8b7e2e865fef94d6a46746c3b7f334b910814031 (patch) | |
tree | fe5142402e13096b866261285c30013571ad33a2 | |
parent | eb6944f2fc01d5c83bce37fa0e68810565f78a75 (diff) |
vgaarb: Use vgaarb: prefix consistently in messages
Define the pr_fmt() macro to causes all messages emitted by pr_*()
functions to be prefixed with "vgaarb: ".
Signed-off-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
-rw-r--r-- | drivers/gpu/vga/vgaarb.c | 39 |
1 files changed, 20 insertions, 19 deletions
diff --git a/drivers/gpu/vga/vgaarb.c b/drivers/gpu/vga/vgaarb.c index 3b1e65b3d454..5f1bde5efc7f 100644 --- a/drivers/gpu/vga/vgaarb.c +++ b/drivers/gpu/vga/vgaarb.c | |||
@@ -29,6 +29,8 @@ | |||
29 | * | 29 | * |
30 | */ | 30 | */ |
31 | 31 | ||
32 | #define pr_fmt(fmt) "vgaarb: " fmt | ||
33 | |||
32 | #include <linux/module.h> | 34 | #include <linux/module.h> |
33 | #include <linux/kernel.h> | 35 | #include <linux/kernel.h> |
34 | #include <linux/pci.h> | 36 | #include <linux/pci.h> |
@@ -527,7 +529,7 @@ static bool vga_arbiter_add_pci_device(struct pci_dev *pdev) | |||
527 | /* Allocate structure */ | 529 | /* Allocate structure */ |
528 | vgadev = kmalloc(sizeof(struct vga_device), GFP_KERNEL); | 530 | vgadev = kmalloc(sizeof(struct vga_device), GFP_KERNEL); |
529 | if (vgadev == NULL) { | 531 | if (vgadev == NULL) { |
530 | pr_err("vgaarb: failed to allocate pci device\n"); | 532 | pr_err("failed to allocate pci device\n"); |
531 | /* What to do on allocation failure ? For now, let's | 533 | /* What to do on allocation failure ? For now, let's |
532 | * just do nothing, I'm not sure there is anything saner | 534 | * just do nothing, I'm not sure there is anything saner |
533 | * to be done | 535 | * to be done |
@@ -581,8 +583,7 @@ static bool vga_arbiter_add_pci_device(struct pci_dev *pdev) | |||
581 | */ | 583 | */ |
582 | if (vga_default == NULL && | 584 | if (vga_default == NULL && |
583 | ((vgadev->owns & VGA_RSRC_LEGACY_MASK) == VGA_RSRC_LEGACY_MASK)) { | 585 | ((vgadev->owns & VGA_RSRC_LEGACY_MASK) == VGA_RSRC_LEGACY_MASK)) { |
584 | pr_info("vgaarb: setting as boot device: PCI:%s\n", | 586 | pr_info("setting as boot device: PCI:%s\n", pci_name(pdev)); |
585 | pci_name(pdev)); | ||
586 | vga_set_default_device(pdev); | 587 | vga_set_default_device(pdev); |
587 | } | 588 | } |
588 | 589 | ||
@@ -591,7 +592,7 @@ static bool vga_arbiter_add_pci_device(struct pci_dev *pdev) | |||
591 | /* Add to the list */ | 592 | /* Add to the list */ |
592 | list_add(&vgadev->list, &vga_list); | 593 | list_add(&vgadev->list, &vga_list); |
593 | vga_count++; | 594 | vga_count++; |
594 | pr_info("vgaarb: device added: PCI:%s,decodes=%s,owns=%s,locks=%s\n", | 595 | pr_info("device added: PCI:%s,decodes=%s,owns=%s,locks=%s\n", |
595 | pci_name(pdev), | 596 | pci_name(pdev), |
596 | vga_iostate_to_str(vgadev->decodes), | 597 | vga_iostate_to_str(vgadev->decodes), |
597 | vga_iostate_to_str(vgadev->owns), | 598 | vga_iostate_to_str(vgadev->owns), |
@@ -651,7 +652,7 @@ static inline void vga_update_device_decodes(struct vga_device *vgadev, | |||
651 | decodes_unlocked = vgadev->locks & decodes_removed; | 652 | decodes_unlocked = vgadev->locks & decodes_removed; |
652 | vgadev->decodes = new_decodes; | 653 | vgadev->decodes = new_decodes; |
653 | 654 | ||
654 | pr_info("vgaarb: device changed decodes: PCI:%s,olddecodes=%s,decodes=%s:owns=%s\n", | 655 | pr_info("device changed decodes: PCI:%s,olddecodes=%s,decodes=%s:owns=%s\n", |
655 | pci_name(vgadev->pdev), | 656 | pci_name(vgadev->pdev), |
656 | vga_iostate_to_str(old_decodes), | 657 | vga_iostate_to_str(old_decodes), |
657 | vga_iostate_to_str(vgadev->decodes), | 658 | vga_iostate_to_str(vgadev->decodes), |
@@ -673,7 +674,7 @@ static inline void vga_update_device_decodes(struct vga_device *vgadev, | |||
673 | if (!(old_decodes & VGA_RSRC_LEGACY_MASK) && | 674 | if (!(old_decodes & VGA_RSRC_LEGACY_MASK) && |
674 | new_decodes & VGA_RSRC_LEGACY_MASK) | 675 | new_decodes & VGA_RSRC_LEGACY_MASK) |
675 | vga_decode_count++; | 676 | vga_decode_count++; |
676 | pr_debug("vgaarb: decoding count now is: %d\n", vga_decode_count); | 677 | pr_debug("decoding count now is: %d\n", vga_decode_count); |
677 | } | 678 | } |
678 | 679 | ||
679 | static void __vga_set_legacy_decoding(struct pci_dev *pdev, unsigned int decodes, bool userspace) | 680 | static void __vga_set_legacy_decoding(struct pci_dev *pdev, unsigned int decodes, bool userspace) |
@@ -1075,13 +1076,13 @@ static ssize_t vga_arb_write(struct file *file, const char __user * buf, | |||
1075 | ret_val = -EPROTO; | 1076 | ret_val = -EPROTO; |
1076 | goto done; | 1077 | goto done; |
1077 | } | 1078 | } |
1078 | pr_debug("vgaarb: %s ==> %x:%x:%x.%x\n", curr_pos, | 1079 | pr_debug("%s ==> %x:%x:%x.%x\n", curr_pos, |
1079 | domain, bus, PCI_SLOT(devfn), PCI_FUNC(devfn)); | 1080 | domain, bus, PCI_SLOT(devfn), PCI_FUNC(devfn)); |
1080 | 1081 | ||
1081 | pdev = pci_get_domain_bus_and_slot(domain, bus, devfn); | 1082 | pdev = pci_get_domain_bus_and_slot(domain, bus, devfn); |
1082 | pr_debug("vgaarb: pdev %p\n", pdev); | 1083 | pr_debug("pdev %p\n", pdev); |
1083 | if (!pdev) { | 1084 | if (!pdev) { |
1084 | pr_err("vgaarb: invalid PCI address %x:%x:%x\n", | 1085 | pr_err("invalid PCI address %x:%x:%x\n", |
1085 | domain, bus, devfn); | 1086 | domain, bus, devfn); |
1086 | ret_val = -ENODEV; | 1087 | ret_val = -ENODEV; |
1087 | goto done; | 1088 | goto done; |
@@ -1089,10 +1090,10 @@ static ssize_t vga_arb_write(struct file *file, const char __user * buf, | |||
1089 | } | 1090 | } |
1090 | 1091 | ||
1091 | vgadev = vgadev_find(pdev); | 1092 | vgadev = vgadev_find(pdev); |
1092 | pr_debug("vgaarb: vgadev %p\n", vgadev); | 1093 | pr_debug("vgadev %p\n", vgadev); |
1093 | if (vgadev == NULL) { | 1094 | if (vgadev == NULL) { |
1094 | if (pdev) { | 1095 | if (pdev) { |
1095 | pr_err("vgaarb: this pci device is not a vga device\n"); | 1096 | pr_err("this pci device is not a vga device\n"); |
1096 | pci_dev_put(pdev); | 1097 | pci_dev_put(pdev); |
1097 | } | 1098 | } |
1098 | 1099 | ||
@@ -1112,7 +1113,7 @@ static ssize_t vga_arb_write(struct file *file, const char __user * buf, | |||
1112 | } | 1113 | } |
1113 | } | 1114 | } |
1114 | if (i == MAX_USER_CARDS) { | 1115 | if (i == MAX_USER_CARDS) { |
1115 | pr_err("vgaarb: maximum user cards (%d) number reached!\n", | 1116 | pr_err("maximum user cards (%d) number reached!\n", |
1116 | MAX_USER_CARDS); | 1117 | MAX_USER_CARDS); |
1117 | pci_dev_put(pdev); | 1118 | pci_dev_put(pdev); |
1118 | /* XXX: which value to return? */ | 1119 | /* XXX: which value to return? */ |
@@ -1128,7 +1129,7 @@ static ssize_t vga_arb_write(struct file *file, const char __user * buf, | |||
1128 | } else if (strncmp(curr_pos, "decodes ", 8) == 0) { | 1129 | } else if (strncmp(curr_pos, "decodes ", 8) == 0) { |
1129 | curr_pos += 8; | 1130 | curr_pos += 8; |
1130 | remaining -= 8; | 1131 | remaining -= 8; |
1131 | pr_debug("vgaarb: client 0x%p called 'decodes'\n", priv); | 1132 | pr_debug("client 0x%p called 'decodes'\n", priv); |
1132 | 1133 | ||
1133 | if (!vga_str_to_iostate(curr_pos, remaining, &io_state)) { | 1134 | if (!vga_str_to_iostate(curr_pos, remaining, &io_state)) { |
1134 | ret_val = -EPROTO; | 1135 | ret_val = -EPROTO; |
@@ -1303,7 +1304,7 @@ static int __init vga_arb_device_init(void) | |||
1303 | 1304 | ||
1304 | rc = misc_register(&vga_arb_device); | 1305 | rc = misc_register(&vga_arb_device); |
1305 | if (rc < 0) | 1306 | if (rc < 0) |
1306 | pr_err("vgaarb: error %d registering device\n", rc); | 1307 | pr_err("error %d registering device\n", rc); |
1307 | 1308 | ||
1308 | bus_register_notifier(&pci_bus_type, &pci_notifier); | 1309 | bus_register_notifier(&pci_bus_type, &pci_notifier); |
1309 | 1310 | ||
@@ -1315,7 +1316,7 @@ static int __init vga_arb_device_init(void) | |||
1315 | PCI_ANY_ID, pdev)) != NULL) | 1316 | PCI_ANY_ID, pdev)) != NULL) |
1316 | vga_arbiter_add_pci_device(pdev); | 1317 | vga_arbiter_add_pci_device(pdev); |
1317 | 1318 | ||
1318 | pr_info("vgaarb: loaded\n"); | 1319 | pr_info("loaded\n"); |
1319 | 1320 | ||
1320 | list_for_each_entry(vgadev, &vga_list, list) { | 1321 | list_for_each_entry(vgadev, &vga_list, list) { |
1321 | #if defined(CONFIG_X86) || defined(CONFIG_IA64) | 1322 | #if defined(CONFIG_X86) || defined(CONFIG_IA64) |
@@ -1342,18 +1343,18 @@ static int __init vga_arb_device_init(void) | |||
1342 | (screen_info.lfb_base + screen_info.lfb_size) >= end) | 1343 | (screen_info.lfb_base + screen_info.lfb_size) >= end) |
1343 | continue; | 1344 | continue; |
1344 | if (!vga_default_device()) | 1345 | if (!vga_default_device()) |
1345 | pr_info("vgaarb: setting as boot device: PCI:%s\n", | 1346 | pr_info("setting as boot device: PCI:%s\n", |
1346 | pci_name(vgadev->pdev)); | 1347 | pci_name(vgadev->pdev)); |
1347 | else if (vgadev->pdev != vga_default_device()) | 1348 | else if (vgadev->pdev != vga_default_device()) |
1348 | pr_info("vgaarb: overriding boot device: PCI:%s\n", | 1349 | pr_info("overriding boot device: PCI:%s\n", |
1349 | pci_name(vgadev->pdev)); | 1350 | pci_name(vgadev->pdev)); |
1350 | vga_set_default_device(vgadev->pdev); | 1351 | vga_set_default_device(vgadev->pdev); |
1351 | } | 1352 | } |
1352 | #endif | 1353 | #endif |
1353 | if (vgadev->bridge_has_one_vga) | 1354 | if (vgadev->bridge_has_one_vga) |
1354 | pr_info("vgaarb: bridge control possible %s\n", pci_name(vgadev->pdev)); | 1355 | pr_info("bridge control possible %s\n", pci_name(vgadev->pdev)); |
1355 | else | 1356 | else |
1356 | pr_info("vgaarb: no bridge control possible %s\n", pci_name(vgadev->pdev)); | 1357 | pr_info("no bridge control possible %s\n", pci_name(vgadev->pdev)); |
1357 | } | 1358 | } |
1358 | return rc; | 1359 | return rc; |
1359 | } | 1360 | } |