diff options
author | Joe Perches <joe@perches.com> | 2012-02-15 18:06:19 -0500 |
---|---|---|
committer | Wim Van Sebroeck <wim@iguana.be> | 2012-03-27 13:59:26 -0400 |
commit | 27c766aaacb265d625dc634bf7903f7f9fd0c697 (patch) | |
tree | 06b399d21dec006bc0a3e1c6685b076753e19b94 /drivers/watchdog/iTCO_wdt.c | |
parent | 7cbc353540c31ffaf65ad44d89b955be0f1d04dc (diff) |
watchdog: Use pr_<fmt> and pr_<level>
Use the current logging styles.
Make sure all output has a prefix.
Add missing newlines.
Remove now unnecessary PFX, NAME, and miscellaneous other #defines.
Coalesce formats.
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
Diffstat (limited to 'drivers/watchdog/iTCO_wdt.c')
-rw-r--r-- | drivers/watchdog/iTCO_wdt.c | 55 |
1 files changed, 23 insertions, 32 deletions
diff --git a/drivers/watchdog/iTCO_wdt.c b/drivers/watchdog/iTCO_wdt.c index bdf401b240b5..3b4db72f6ac8 100644 --- a/drivers/watchdog/iTCO_wdt.c +++ b/drivers/watchdog/iTCO_wdt.c | |||
@@ -43,10 +43,11 @@ | |||
43 | * Includes, defines, variables, module parameters, ... | 43 | * Includes, defines, variables, module parameters, ... |
44 | */ | 44 | */ |
45 | 45 | ||
46 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
47 | |||
46 | /* Module and version information */ | 48 | /* Module and version information */ |
47 | #define DRV_NAME "iTCO_wdt" | 49 | #define DRV_NAME "iTCO_wdt" |
48 | #define DRV_VERSION "1.07" | 50 | #define DRV_VERSION "1.07" |
49 | #define PFX DRV_NAME ": " | ||
50 | 51 | ||
51 | /* Includes */ | 52 | /* Includes */ |
52 | #include <linux/module.h> /* For module specific items */ | 53 | #include <linux/module.h> /* For module specific items */ |
@@ -489,8 +490,7 @@ static int iTCO_wdt_start(void) | |||
489 | /* disable chipset's NO_REBOOT bit */ | 490 | /* disable chipset's NO_REBOOT bit */ |
490 | if (iTCO_wdt_unset_NO_REBOOT_bit()) { | 491 | if (iTCO_wdt_unset_NO_REBOOT_bit()) { |
491 | spin_unlock(&iTCO_wdt_private.io_lock); | 492 | spin_unlock(&iTCO_wdt_private.io_lock); |
492 | printk(KERN_ERR PFX "failed to reset NO_REBOOT flag, " | 493 | pr_err("failed to reset NO_REBOOT flag, reboot disabled by hardware/BIOS\n"); |
493 | "reboot disabled by hardware/BIOS\n"); | ||
494 | return -EIO; | 494 | return -EIO; |
495 | } | 495 | } |
496 | 496 | ||
@@ -661,8 +661,7 @@ static int iTCO_wdt_release(struct inode *inode, struct file *file) | |||
661 | if (expect_release == 42) { | 661 | if (expect_release == 42) { |
662 | iTCO_wdt_stop(); | 662 | iTCO_wdt_stop(); |
663 | } else { | 663 | } else { |
664 | printk(KERN_CRIT PFX | 664 | pr_crit("Unexpected close, not stopping watchdog!\n"); |
665 | "Unexpected close, not stopping watchdog!\n"); | ||
666 | iTCO_wdt_keepalive(); | 665 | iTCO_wdt_keepalive(); |
667 | } | 666 | } |
668 | clear_bit(0, &is_active); | 667 | clear_bit(0, &is_active); |
@@ -804,8 +803,7 @@ static int __devinit iTCO_wdt_init(struct pci_dev *pdev, | |||
804 | base_address &= 0x0000ff80; | 803 | base_address &= 0x0000ff80; |
805 | if (base_address == 0x00000000) { | 804 | if (base_address == 0x00000000) { |
806 | /* Something's wrong here, ACPIBASE has to be set */ | 805 | /* Something's wrong here, ACPIBASE has to be set */ |
807 | printk(KERN_ERR PFX "failed to get TCOBASE address, " | 806 | pr_err("failed to get TCOBASE address, device disabled by hardware/BIOS\n"); |
808 | "device disabled by hardware/BIOS\n"); | ||
809 | return -ENODEV; | 807 | return -ENODEV; |
810 | } | 808 | } |
811 | iTCO_wdt_private.iTCO_version = | 809 | iTCO_wdt_private.iTCO_version = |
@@ -820,8 +818,7 @@ static int __devinit iTCO_wdt_init(struct pci_dev *pdev, | |||
820 | if (iTCO_wdt_private.iTCO_version == 2) { | 818 | if (iTCO_wdt_private.iTCO_version == 2) { |
821 | pci_read_config_dword(pdev, 0xf0, &base_address); | 819 | pci_read_config_dword(pdev, 0xf0, &base_address); |
822 | if ((base_address & 1) == 0) { | 820 | if ((base_address & 1) == 0) { |
823 | printk(KERN_ERR PFX "RCBA is disabled by hardware" | 821 | pr_err("RCBA is disabled by hardware/BIOS, device disabled\n"); |
824 | "/BIOS, device disabled\n"); | ||
825 | ret = -ENODEV; | 822 | ret = -ENODEV; |
826 | goto out; | 823 | goto out; |
827 | } | 824 | } |
@@ -831,8 +828,7 @@ static int __devinit iTCO_wdt_init(struct pci_dev *pdev, | |||
831 | 828 | ||
832 | /* Check chipset's NO_REBOOT bit */ | 829 | /* Check chipset's NO_REBOOT bit */ |
833 | if (iTCO_wdt_unset_NO_REBOOT_bit() && iTCO_vendor_check_noreboot_on()) { | 830 | if (iTCO_wdt_unset_NO_REBOOT_bit() && iTCO_vendor_check_noreboot_on()) { |
834 | printk(KERN_INFO PFX "unable to reset NO_REBOOT flag, " | 831 | pr_info("unable to reset NO_REBOOT flag, device disabled by hardware/BIOS\n"); |
835 | "device disabled by hardware/BIOS\n"); | ||
836 | ret = -ENODEV; /* Cannot reset NO_REBOOT bit */ | 832 | ret = -ENODEV; /* Cannot reset NO_REBOOT bit */ |
837 | goto out_unmap; | 833 | goto out_unmap; |
838 | } | 834 | } |
@@ -842,9 +838,8 @@ static int __devinit iTCO_wdt_init(struct pci_dev *pdev, | |||
842 | 838 | ||
843 | /* The TCO logic uses the TCO_EN bit in the SMI_EN register */ | 839 | /* The TCO logic uses the TCO_EN bit in the SMI_EN register */ |
844 | if (!request_region(SMI_EN, 4, "iTCO_wdt")) { | 840 | if (!request_region(SMI_EN, 4, "iTCO_wdt")) { |
845 | printk(KERN_ERR PFX | 841 | pr_err("I/O address 0x%04lx already in use, device disabled\n", |
846 | "I/O address 0x%04lx already in use, " | 842 | SMI_EN); |
847 | "device disabled\n", SMI_EN); | ||
848 | ret = -EIO; | 843 | ret = -EIO; |
849 | goto out_unmap; | 844 | goto out_unmap; |
850 | } | 845 | } |
@@ -858,17 +853,16 @@ static int __devinit iTCO_wdt_init(struct pci_dev *pdev, | |||
858 | /* The TCO I/O registers reside in a 32-byte range pointed to | 853 | /* The TCO I/O registers reside in a 32-byte range pointed to |
859 | by the TCOBASE value */ | 854 | by the TCOBASE value */ |
860 | if (!request_region(TCOBASE, 0x20, "iTCO_wdt")) { | 855 | if (!request_region(TCOBASE, 0x20, "iTCO_wdt")) { |
861 | printk(KERN_ERR PFX "I/O address 0x%04lx already in use " | 856 | pr_err("I/O address 0x%04lx already in use, device disabled\n", |
862 | "device disabled\n", TCOBASE); | 857 | TCOBASE); |
863 | ret = -EIO; | 858 | ret = -EIO; |
864 | goto unreg_smi_en; | 859 | goto unreg_smi_en; |
865 | } | 860 | } |
866 | 861 | ||
867 | printk(KERN_INFO PFX | 862 | pr_info("Found a %s TCO device (Version=%d, TCOBASE=0x%04lx)\n", |
868 | "Found a %s TCO device (Version=%d, TCOBASE=0x%04lx)\n", | 863 | iTCO_chipset_info[ent->driver_data].name, |
869 | iTCO_chipset_info[ent->driver_data].name, | 864 | iTCO_chipset_info[ent->driver_data].iTCO_version, |
870 | iTCO_chipset_info[ent->driver_data].iTCO_version, | 865 | TCOBASE); |
871 | TCOBASE); | ||
872 | 866 | ||
873 | /* Clear out the (probably old) status */ | 867 | /* Clear out the (probably old) status */ |
874 | outw(0x0008, TCO1_STS); /* Clear the Time Out Status bit */ | 868 | outw(0x0008, TCO1_STS); /* Clear the Time Out Status bit */ |
@@ -882,20 +876,18 @@ static int __devinit iTCO_wdt_init(struct pci_dev *pdev, | |||
882 | if not reset to the default */ | 876 | if not reset to the default */ |
883 | if (iTCO_wdt_set_heartbeat(heartbeat)) { | 877 | if (iTCO_wdt_set_heartbeat(heartbeat)) { |
884 | iTCO_wdt_set_heartbeat(WATCHDOG_HEARTBEAT); | 878 | iTCO_wdt_set_heartbeat(WATCHDOG_HEARTBEAT); |
885 | printk(KERN_INFO PFX | 879 | pr_info("timeout value out of range, using %d\n", heartbeat); |
886 | "timeout value out of range, using %d\n", heartbeat); | ||
887 | } | 880 | } |
888 | 881 | ||
889 | ret = misc_register(&iTCO_wdt_miscdev); | 882 | ret = misc_register(&iTCO_wdt_miscdev); |
890 | if (ret != 0) { | 883 | if (ret != 0) { |
891 | printk(KERN_ERR PFX | 884 | pr_err("cannot register miscdev on minor=%d (err=%d)\n", |
892 | "cannot register miscdev on minor=%d (err=%d)\n", | 885 | WATCHDOG_MINOR, ret); |
893 | WATCHDOG_MINOR, ret); | ||
894 | goto unreg_region; | 886 | goto unreg_region; |
895 | } | 887 | } |
896 | 888 | ||
897 | printk(KERN_INFO PFX "initialized. heartbeat=%d sec (nowayout=%d)\n", | 889 | pr_info("initialized. heartbeat=%d sec (nowayout=%d)\n", |
898 | heartbeat, nowayout); | 890 | heartbeat, nowayout); |
899 | 891 | ||
900 | return 0; | 892 | return 0; |
901 | 893 | ||
@@ -947,7 +939,7 @@ static int __devinit iTCO_wdt_probe(struct platform_device *dev) | |||
947 | } | 939 | } |
948 | 940 | ||
949 | if (!found) | 941 | if (!found) |
950 | printk(KERN_INFO PFX "No device detected.\n"); | 942 | pr_info("No device detected\n"); |
951 | 943 | ||
952 | return ret; | 944 | return ret; |
953 | } | 945 | } |
@@ -979,8 +971,7 @@ static int __init iTCO_wdt_init_module(void) | |||
979 | { | 971 | { |
980 | int err; | 972 | int err; |
981 | 973 | ||
982 | printk(KERN_INFO PFX "Intel TCO WatchDog Timer Driver v%s\n", | 974 | pr_info("Intel TCO WatchDog Timer Driver v%s\n", DRV_VERSION); |
983 | DRV_VERSION); | ||
984 | 975 | ||
985 | err = platform_driver_register(&iTCO_wdt_driver); | 976 | err = platform_driver_register(&iTCO_wdt_driver); |
986 | if (err) | 977 | if (err) |
@@ -1004,7 +995,7 @@ static void __exit iTCO_wdt_cleanup_module(void) | |||
1004 | { | 995 | { |
1005 | platform_device_unregister(iTCO_wdt_platform_device); | 996 | platform_device_unregister(iTCO_wdt_platform_device); |
1006 | platform_driver_unregister(&iTCO_wdt_driver); | 997 | platform_driver_unregister(&iTCO_wdt_driver); |
1007 | printk(KERN_INFO PFX "Watchdog Module Unloaded.\n"); | 998 | pr_info("Watchdog Module Unloaded\n"); |
1008 | } | 999 | } |
1009 | 1000 | ||
1010 | module_init(iTCO_wdt_init_module); | 1001 | module_init(iTCO_wdt_init_module); |