diff options
author | malattia@linux.it <malattia@linux.it> | 2007-04-09 13:31:06 -0400 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2007-04-10 16:01:19 -0400 |
commit | f6119b027578c21b544a98fd67e5f0b7e4fbea7d (patch) | |
tree | a19192416f170ae96c54b5b17e7a7755806bfd66 | |
parent | 49a11deade3c1d9e2d7c88d25899b3a9174d048e (diff) |
sony-laptop: sanitize printks
Unify printks to resemble a unique driver.
Signed-off-by: Mattia Dongili <malattia@linux.it>
Signed-off-by: Len Brown <len.brown@intel.com>
-rw-r--r-- | drivers/misc/sony-laptop.c | 40 |
1 files changed, 19 insertions, 21 deletions
diff --git a/drivers/misc/sony-laptop.c b/drivers/misc/sony-laptop.c index 3e8f3aaa0923..9042184d543a 100644 --- a/drivers/misc/sony-laptop.c +++ b/drivers/misc/sony-laptop.c | |||
@@ -64,20 +64,19 @@ | |||
64 | #include <linux/sonypi.h> | 64 | #include <linux/sonypi.h> |
65 | 65 | ||
66 | #define DRV_PFX "sony-laptop: " | 66 | #define DRV_PFX "sony-laptop: " |
67 | #define LOG_PFX KERN_WARNING DRV_PFX | ||
68 | #define dprintk(msg...) do { \ | 67 | #define dprintk(msg...) do { \ |
69 | if (debug) printk(LOG_PFX msg); \ | 68 | if (debug) printk(KERN_WARNING DRV_PFX msg); \ |
70 | } while (0) | 69 | } while (0) |
71 | 70 | ||
72 | #define SONY_LAPTOP_DRIVER_VERSION "0.5" | 71 | #define SONY_LAPTOP_DRIVER_VERSION "0.5" |
73 | 72 | ||
74 | #define SONY_NC_CLASS "sony-nc" | 73 | #define SONY_NC_CLASS "sony-nc" |
75 | #define SONY_NC_HID "SNY5001" | 74 | #define SONY_NC_HID "SNY5001" |
76 | #define SONY_NC_DRIVER_NAME "Sony Notebook Control" | 75 | #define SONY_NC_DRIVER_NAME "Sony Notebook Control Driver" |
77 | 76 | ||
78 | #define SONY_PIC_CLASS "sony-pic" | 77 | #define SONY_PIC_CLASS "sony-pic" |
79 | #define SONY_PIC_HID "SNY6001" | 78 | #define SONY_PIC_HID "SNY6001" |
80 | #define SONY_PIC_DRIVER_NAME "Sony Programmable IO Control" | 79 | #define SONY_PIC_DRIVER_NAME "Sony Programmable IO Control Driver" |
81 | 80 | ||
82 | MODULE_AUTHOR("Stelian Pop, Mattia Dongili"); | 81 | MODULE_AUTHOR("Stelian Pop, Mattia Dongili"); |
83 | MODULE_DESCRIPTION("Sony laptop extras driver (SPIC and SNC ACPI device)"); | 82 | MODULE_DESCRIPTION("Sony laptop extras driver (SPIC and SNC ACPI device)"); |
@@ -518,7 +517,7 @@ static int acpi_callgetfunc(acpi_handle handle, char *name, int *result) | |||
518 | return 0; | 517 | return 0; |
519 | } | 518 | } |
520 | 519 | ||
521 | printk(LOG_PFX "acpi_callreadfunc failed\n"); | 520 | printk(KERN_WARNING DRV_PFX "acpi_callreadfunc failed\n"); |
522 | 521 | ||
523 | return -1; | 522 | return -1; |
524 | } | 523 | } |
@@ -544,7 +543,7 @@ static int acpi_callsetfunc(acpi_handle handle, char *name, int value, | |||
544 | if (status == AE_OK) { | 543 | if (status == AE_OK) { |
545 | if (result != NULL) { | 544 | if (result != NULL) { |
546 | if (out_obj.type != ACPI_TYPE_INTEGER) { | 545 | if (out_obj.type != ACPI_TYPE_INTEGER) { |
547 | printk(LOG_PFX "acpi_evaluate_object bad " | 546 | printk(KERN_WARNING DRV_PFX "acpi_evaluate_object bad " |
548 | "return type\n"); | 547 | "return type\n"); |
549 | return -1; | 548 | return -1; |
550 | } | 549 | } |
@@ -553,7 +552,7 @@ static int acpi_callsetfunc(acpi_handle handle, char *name, int value, | |||
553 | return 0; | 552 | return 0; |
554 | } | 553 | } |
555 | 554 | ||
556 | printk(LOG_PFX "acpi_evaluate_object failed\n"); | 555 | printk(KERN_WARNING DRV_PFX "acpi_evaluate_object failed\n"); |
557 | 556 | ||
558 | return -1; | 557 | return -1; |
559 | } | 558 | } |
@@ -689,7 +688,7 @@ static acpi_status sony_walk_callback(acpi_handle handle, u32 level, | |||
689 | node = (struct acpi_namespace_node *)handle; | 688 | node = (struct acpi_namespace_node *)handle; |
690 | operand = (union acpi_operand_object *)node->object; | 689 | operand = (union acpi_operand_object *)node->object; |
691 | 690 | ||
692 | printk(LOG_PFX "method: name: %4.4s, args %X\n", node->name.ascii, | 691 | printk(KERN_WARNING DRV_PFX "method: name: %4.4s, args %X\n", node->name.ascii, |
693 | (u32) operand->method.param_count); | 692 | (u32) operand->method.param_count); |
694 | 693 | ||
695 | return AE_OK; | 694 | return AE_OK; |
@@ -724,6 +723,9 @@ static int sony_nc_add(struct acpi_device *device) | |||
724 | acpi_handle handle; | 723 | acpi_handle handle; |
725 | struct sony_nc_value *item; | 724 | struct sony_nc_value *item; |
726 | 725 | ||
726 | printk(KERN_INFO DRV_PFX "%s v%s.\n", | ||
727 | SONY_NC_DRIVER_NAME, SONY_LAPTOP_DRIVER_VERSION); | ||
728 | |||
727 | sony_nc_acpi_device = device; | 729 | sony_nc_acpi_device = device; |
728 | strcpy(acpi_device_class(device), "sony/hotkey"); | 730 | strcpy(acpi_device_class(device), "sony/hotkey"); |
729 | 731 | ||
@@ -733,7 +735,7 @@ static int sony_nc_add(struct acpi_device *device) | |||
733 | status = acpi_walk_namespace(ACPI_TYPE_METHOD, sony_nc_acpi_handle, | 735 | status = acpi_walk_namespace(ACPI_TYPE_METHOD, sony_nc_acpi_handle, |
734 | 1, sony_walk_callback, NULL, NULL); | 736 | 1, sony_walk_callback, NULL, NULL); |
735 | if (ACPI_FAILURE(status)) { | 737 | if (ACPI_FAILURE(status)) { |
736 | printk(LOG_PFX "unable to walk acpi resources\n"); | 738 | printk(KERN_WARNING DRV_PFX "unable to walk acpi resources\n"); |
737 | result = -ENODEV; | 739 | result = -ENODEV; |
738 | goto outwalk; | 740 | goto outwalk; |
739 | } | 741 | } |
@@ -751,7 +753,7 @@ static int sony_nc_add(struct acpi_device *device) | |||
751 | ACPI_DEVICE_NOTIFY, | 753 | ACPI_DEVICE_NOTIFY, |
752 | sony_acpi_notify, NULL); | 754 | sony_acpi_notify, NULL); |
753 | if (ACPI_FAILURE(status)) { | 755 | if (ACPI_FAILURE(status)) { |
754 | printk(LOG_PFX "unable to install notify handler\n"); | 756 | printk(KERN_WARNING DRV_PFX "unable to install notify handler\n"); |
755 | result = -ENODEV; | 757 | result = -ENODEV; |
756 | goto outinput; | 758 | goto outinput; |
757 | } | 759 | } |
@@ -762,7 +764,7 @@ static int sony_nc_add(struct acpi_device *device) | |||
762 | &sony_backlight_ops); | 764 | &sony_backlight_ops); |
763 | 765 | ||
764 | if (IS_ERR(sony_backlight_device)) { | 766 | if (IS_ERR(sony_backlight_device)) { |
765 | printk(LOG_PFX "unable to register backlight device\n"); | 767 | printk(KERN_WARNING DRV_PFX "unable to register backlight device\n"); |
766 | sony_backlight_device = NULL; | 768 | sony_backlight_device = NULL; |
767 | } else { | 769 | } else { |
768 | sony_backlight_device->props.brightness = | 770 | sony_backlight_device->props.brightness = |
@@ -817,8 +819,6 @@ static int sony_nc_add(struct acpi_device *device) | |||
817 | } | 819 | } |
818 | } | 820 | } |
819 | 821 | ||
820 | printk(KERN_INFO SONY_NC_DRIVER_NAME " successfully installed\n"); | ||
821 | |||
822 | return 0; | 822 | return 0; |
823 | 823 | ||
824 | out_sysfs: | 824 | out_sysfs: |
@@ -835,7 +835,7 @@ static int sony_nc_add(struct acpi_device *device) | |||
835 | ACPI_DEVICE_NOTIFY, | 835 | ACPI_DEVICE_NOTIFY, |
836 | sony_acpi_notify); | 836 | sony_acpi_notify); |
837 | if (ACPI_FAILURE(status)) | 837 | if (ACPI_FAILURE(status)) |
838 | printk(LOG_PFX "unable to remove notify handler\n"); | 838 | printk(KERN_WARNING DRV_PFX "unable to remove notify handler\n"); |
839 | 839 | ||
840 | outinput: | 840 | outinput: |
841 | sony_laptop_remove_input(); | 841 | sony_laptop_remove_input(); |
@@ -858,7 +858,7 @@ static int sony_nc_remove(struct acpi_device *device, int type) | |||
858 | ACPI_DEVICE_NOTIFY, | 858 | ACPI_DEVICE_NOTIFY, |
859 | sony_acpi_notify); | 859 | sony_acpi_notify); |
860 | if (ACPI_FAILURE(status)) | 860 | if (ACPI_FAILURE(status)) |
861 | printk(LOG_PFX "unable to remove notify handler\n"); | 861 | printk(KERN_WARNING DRV_PFX "unable to remove notify handler\n"); |
862 | 862 | ||
863 | for (item = sony_nc_values; item->name; ++item) { | 863 | for (item = sony_nc_values; item->name; ++item) { |
864 | device_remove_file(&sony_pf_device->dev, &item->devattr); | 864 | device_remove_file(&sony_pf_device->dev, &item->devattr); |
@@ -866,8 +866,7 @@ static int sony_nc_remove(struct acpi_device *device, int type) | |||
866 | 866 | ||
867 | sony_pf_remove(); | 867 | sony_pf_remove(); |
868 | sony_laptop_remove_input(); | 868 | sony_laptop_remove_input(); |
869 | 869 | dprintk(SONY_NC_DRIVER_NAME " removed.\n"); | |
870 | printk(KERN_INFO SONY_NC_DRIVER_NAME " successfully removed\n"); | ||
871 | 870 | ||
872 | return 0; | 871 | return 0; |
873 | } | 872 | } |
@@ -1645,7 +1644,7 @@ static int sony_pic_remove(struct acpi_device *device, int type) | |||
1645 | spic_dev.cur_ioport = NULL; | 1644 | spic_dev.cur_ioport = NULL; |
1646 | spic_dev.cur_irq = NULL; | 1645 | spic_dev.cur_irq = NULL; |
1647 | 1646 | ||
1648 | dprintk("removed.\n"); | 1647 | dprintk(SONY_PIC_DRIVER_NAME " removed.\n"); |
1649 | return 0; | 1648 | return 0; |
1650 | } | 1649 | } |
1651 | 1650 | ||
@@ -1655,9 +1654,8 @@ static int sony_pic_add(struct acpi_device *device) | |||
1655 | struct sony_pic_ioport *io, *tmp_io; | 1654 | struct sony_pic_ioport *io, *tmp_io; |
1656 | struct sony_pic_irq *irq, *tmp_irq; | 1655 | struct sony_pic_irq *irq, *tmp_irq; |
1657 | 1656 | ||
1658 | printk(KERN_INFO DRV_PFX | 1657 | printk(KERN_INFO DRV_PFX "%s v%s.\n", |
1659 | "Sony Programmable I/O Controller Driver v%s.\n", | 1658 | SONY_PIC_DRIVER_NAME, SONY_LAPTOP_DRIVER_VERSION); |
1660 | SONY_LAPTOP_DRIVER_VERSION); | ||
1661 | 1659 | ||
1662 | spic_dev.acpi_dev = device; | 1660 | spic_dev.acpi_dev = device; |
1663 | strcpy(acpi_device_class(device), "sony/hotkey"); | 1661 | strcpy(acpi_device_class(device), "sony/hotkey"); |