diff options
author | Joe Perches <joe@perches.com> | 2010-10-20 02:51:26 -0400 |
---|---|---|
committer | Guenter Roeck <guenter.roeck@ericsson.com> | 2011-01-08 13:55:01 -0500 |
commit | fe826749aec090c6f9ab48502bb9a7777572b85b (patch) | |
tree | b40f05d85113b0ac0e55374fb2711d8b08b72036 /drivers/hwmon/abituguru3.c | |
parent | 28ebfa13f97265e415fbe19795500a6d922a6c86 (diff) |
hwmon: (abituguru3) Use pr_fmt and pr_<level>
Added #define pr_fmt KBUILD_MODNAME ": " fmt
Converted printks to pr_<level>
Coalesced any long formats
Removed prefixes from formats
Added a few static strings to standardize logging messages.
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
Diffstat (limited to 'drivers/hwmon/abituguru3.c')
-rw-r--r-- | drivers/hwmon/abituguru3.c | 45 |
1 files changed, 19 insertions, 26 deletions
diff --git a/drivers/hwmon/abituguru3.c b/drivers/hwmon/abituguru3.c index 3cf28af614b5..48d21e22e930 100644 --- a/drivers/hwmon/abituguru3.c +++ b/drivers/hwmon/abituguru3.c | |||
@@ -23,6 +23,9 @@ | |||
23 | chip found on newer Abit uGuru motherboards. Note: because of lack of specs | 23 | chip found on newer Abit uGuru motherboards. Note: because of lack of specs |
24 | only reading the sensors and their settings is supported. | 24 | only reading the sensors and their settings is supported. |
25 | */ | 25 | */ |
26 | |||
27 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
28 | |||
26 | #include <linux/module.h> | 29 | #include <linux/module.h> |
27 | #include <linux/init.h> | 30 | #include <linux/init.h> |
28 | #include <linux/slab.h> | 31 | #include <linux/slab.h> |
@@ -608,6 +611,9 @@ static int verbose = 1; | |||
608 | module_param(verbose, bool, 0644); | 611 | module_param(verbose, bool, 0644); |
609 | MODULE_PARM_DESC(verbose, "Enable/disable verbose error reporting"); | 612 | MODULE_PARM_DESC(verbose, "Enable/disable verbose error reporting"); |
610 | 613 | ||
614 | static const char *never_happen = "This should never happen."; | ||
615 | static const char *report_this = | ||
616 | "Please report this to the abituguru3 maintainer (see MAINTAINERS)"; | ||
611 | 617 | ||
612 | /* wait while the uguru is busy (usually after a write) */ | 618 | /* wait while the uguru is busy (usually after a write) */ |
613 | static int abituguru3_wait_while_busy(struct abituguru3_data *data) | 619 | static int abituguru3_wait_while_busy(struct abituguru3_data *data) |
@@ -940,15 +946,13 @@ static int __devinit abituguru3_probe(struct platform_device *pdev) | |||
940 | if (abituguru3_motherboards[i].id == id) | 946 | if (abituguru3_motherboards[i].id == id) |
941 | break; | 947 | break; |
942 | if (!abituguru3_motherboards[i].id) { | 948 | if (!abituguru3_motherboards[i].id) { |
943 | printk(KERN_ERR ABIT_UGURU3_NAME ": error unknown motherboard " | 949 | pr_err("error unknown motherboard ID: %04X. %s\n", |
944 | "ID: %04X. Please report this to the abituguru3 " | 950 | (unsigned int)id, report_this); |
945 | "maintainer (see MAINTAINERS)\n", (unsigned int)id); | ||
946 | goto abituguru3_probe_error; | 951 | goto abituguru3_probe_error; |
947 | } | 952 | } |
948 | data->sensors = abituguru3_motherboards[i].sensors; | 953 | data->sensors = abituguru3_motherboards[i].sensors; |
949 | 954 | ||
950 | printk(KERN_INFO ABIT_UGURU3_NAME ": found Abit uGuru3, motherboard " | 955 | pr_info("found Abit uGuru3, motherboard ID: %04X\n", (unsigned int)id); |
951 | "ID: %04X\n", (unsigned int)id); | ||
952 | 956 | ||
953 | /* Fill the sysfs attr array */ | 957 | /* Fill the sysfs attr array */ |
954 | sysfs_attr_i = 0; | 958 | sysfs_attr_i = 0; |
@@ -957,11 +961,8 @@ static int __devinit abituguru3_probe(struct platform_device *pdev) | |||
957 | for (i = 0; data->sensors[i].name; i++) { | 961 | for (i = 0; data->sensors[i].name; i++) { |
958 | /* Fail safe check, this should never happen! */ | 962 | /* Fail safe check, this should never happen! */ |
959 | if (i >= ABIT_UGURU3_MAX_NO_SENSORS) { | 963 | if (i >= ABIT_UGURU3_MAX_NO_SENSORS) { |
960 | printk(KERN_ERR ABIT_UGURU3_NAME | 964 | pr_err("Fatal error motherboard has more sensors then ABIT_UGURU3_MAX_NO_SENSORS. %s %s\n", |
961 | ": Fatal error motherboard has more sensors " | 965 | never_happen, report_this); |
962 | "then ABIT_UGURU3_MAX_NO_SENSORS. This should " | ||
963 | "never happen please report to the abituguru3 " | ||
964 | "maintainer (see MAINTAINERS)\n"); | ||
965 | res = -ENAMETOOLONG; | 966 | res = -ENAMETOOLONG; |
966 | goto abituguru3_probe_error; | 967 | goto abituguru3_probe_error; |
967 | } | 968 | } |
@@ -983,10 +984,8 @@ static int __devinit abituguru3_probe(struct platform_device *pdev) | |||
983 | } | 984 | } |
984 | /* Fail safe check, this should never happen! */ | 985 | /* Fail safe check, this should never happen! */ |
985 | if (sysfs_names_free < 0) { | 986 | if (sysfs_names_free < 0) { |
986 | printk(KERN_ERR ABIT_UGURU3_NAME | 987 | pr_err("Fatal error ran out of space for sysfs attr names. %s %s\n", |
987 | ": Fatal error ran out of space for sysfs attr names. " | 988 | never_happen, report_this); |
988 | "This should never happen please report to the " | ||
989 | "abituguru3 maintainer (see MAINTAINERS)\n"); | ||
990 | res = -ENAMETOOLONG; | 989 | res = -ENAMETOOLONG; |
991 | goto abituguru3_probe_error; | 990 | goto abituguru3_probe_error; |
992 | } | 991 | } |
@@ -1189,8 +1188,7 @@ static int __init abituguru3_detect(void) | |||
1189 | "0x%02X\n", (unsigned int)data_val, (unsigned int)cmd_val); | 1188 | "0x%02X\n", (unsigned int)data_val, (unsigned int)cmd_val); |
1190 | 1189 | ||
1191 | if (force) { | 1190 | if (force) { |
1192 | printk(KERN_INFO ABIT_UGURU3_NAME ": Assuming Abit uGuru3 is " | 1191 | pr_info("Assuming Abit uGuru3 is present because of \"force\" parameter\n"); |
1193 | "present because of \"force\" parameter\n"); | ||
1194 | return 0; | 1192 | return 0; |
1195 | } | 1193 | } |
1196 | 1194 | ||
@@ -1219,10 +1217,8 @@ static int __init abituguru3_init(void) | |||
1219 | return err; | 1217 | return err; |
1220 | 1218 | ||
1221 | #ifdef CONFIG_DMI | 1219 | #ifdef CONFIG_DMI |
1222 | printk(KERN_WARNING ABIT_UGURU3_NAME ": this motherboard was " | 1220 | pr_warn("this motherboard was not detected using DMI. " |
1223 | "not detected using DMI. Please send the output of " | 1221 | "Please send the output of \"dmidecode\" to the abituguru3 maintainer (see MAINTAINERS)\n"); |
1224 | "\"dmidecode\" to the abituguru3 maintainer " | ||
1225 | "(see MAINTAINERS)\n"); | ||
1226 | #endif | 1222 | #endif |
1227 | } | 1223 | } |
1228 | 1224 | ||
@@ -1233,8 +1229,7 @@ static int __init abituguru3_init(void) | |||
1233 | abituguru3_pdev = platform_device_alloc(ABIT_UGURU3_NAME, | 1229 | abituguru3_pdev = platform_device_alloc(ABIT_UGURU3_NAME, |
1234 | ABIT_UGURU3_BASE); | 1230 | ABIT_UGURU3_BASE); |
1235 | if (!abituguru3_pdev) { | 1231 | if (!abituguru3_pdev) { |
1236 | printk(KERN_ERR ABIT_UGURU3_NAME | 1232 | pr_err("Device allocation failed\n"); |
1237 | ": Device allocation failed\n"); | ||
1238 | err = -ENOMEM; | 1233 | err = -ENOMEM; |
1239 | goto exit_driver_unregister; | 1234 | goto exit_driver_unregister; |
1240 | } | 1235 | } |
@@ -1245,15 +1240,13 @@ static int __init abituguru3_init(void) | |||
1245 | 1240 | ||
1246 | err = platform_device_add_resources(abituguru3_pdev, &res, 1); | 1241 | err = platform_device_add_resources(abituguru3_pdev, &res, 1); |
1247 | if (err) { | 1242 | if (err) { |
1248 | printk(KERN_ERR ABIT_UGURU3_NAME | 1243 | pr_err("Device resource addition failed (%d)\n", err); |
1249 | ": Device resource addition failed (%d)\n", err); | ||
1250 | goto exit_device_put; | 1244 | goto exit_device_put; |
1251 | } | 1245 | } |
1252 | 1246 | ||
1253 | err = platform_device_add(abituguru3_pdev); | 1247 | err = platform_device_add(abituguru3_pdev); |
1254 | if (err) { | 1248 | if (err) { |
1255 | printk(KERN_ERR ABIT_UGURU3_NAME | 1249 | pr_err("Device addition failed (%d)\n", err); |
1256 | ": Device addition failed (%d)\n", err); | ||
1257 | goto exit_device_put; | 1250 | goto exit_device_put; |
1258 | } | 1251 | } |
1259 | 1252 | ||