mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-08 14:13:53 +00:00
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>
This commit is contained in:
parent
28ebfa13f9
commit
fe826749ae
@ -23,6 +23,9 @@
|
|||||||
chip found on newer Abit uGuru motherboards. Note: because of lack of specs
|
chip found on newer Abit uGuru motherboards. Note: because of lack of specs
|
||||||
only reading the sensors and their settings is supported.
|
only reading the sensors and their settings is supported.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
|
||||||
|
|
||||||
#include <linux/module.h>
|
#include <linux/module.h>
|
||||||
#include <linux/init.h>
|
#include <linux/init.h>
|
||||||
#include <linux/slab.h>
|
#include <linux/slab.h>
|
||||||
@ -608,6 +611,9 @@ static int verbose = 1;
|
|||||||
module_param(verbose, bool, 0644);
|
module_param(verbose, bool, 0644);
|
||||||
MODULE_PARM_DESC(verbose, "Enable/disable verbose error reporting");
|
MODULE_PARM_DESC(verbose, "Enable/disable verbose error reporting");
|
||||||
|
|
||||||
|
static const char *never_happen = "This should never happen.";
|
||||||
|
static const char *report_this =
|
||||||
|
"Please report this to the abituguru3 maintainer (see MAINTAINERS)";
|
||||||
|
|
||||||
/* wait while the uguru is busy (usually after a write) */
|
/* wait while the uguru is busy (usually after a write) */
|
||||||
static int abituguru3_wait_while_busy(struct abituguru3_data *data)
|
static int abituguru3_wait_while_busy(struct abituguru3_data *data)
|
||||||
@ -940,15 +946,13 @@ static int __devinit abituguru3_probe(struct platform_device *pdev)
|
|||||||
if (abituguru3_motherboards[i].id == id)
|
if (abituguru3_motherboards[i].id == id)
|
||||||
break;
|
break;
|
||||||
if (!abituguru3_motherboards[i].id) {
|
if (!abituguru3_motherboards[i].id) {
|
||||||
printk(KERN_ERR ABIT_UGURU3_NAME ": error unknown motherboard "
|
pr_err("error unknown motherboard ID: %04X. %s\n",
|
||||||
"ID: %04X. Please report this to the abituguru3 "
|
(unsigned int)id, report_this);
|
||||||
"maintainer (see MAINTAINERS)\n", (unsigned int)id);
|
|
||||||
goto abituguru3_probe_error;
|
goto abituguru3_probe_error;
|
||||||
}
|
}
|
||||||
data->sensors = abituguru3_motherboards[i].sensors;
|
data->sensors = abituguru3_motherboards[i].sensors;
|
||||||
|
|
||||||
printk(KERN_INFO ABIT_UGURU3_NAME ": found Abit uGuru3, motherboard "
|
pr_info("found Abit uGuru3, motherboard ID: %04X\n", (unsigned int)id);
|
||||||
"ID: %04X\n", (unsigned int)id);
|
|
||||||
|
|
||||||
/* Fill the sysfs attr array */
|
/* Fill the sysfs attr array */
|
||||||
sysfs_attr_i = 0;
|
sysfs_attr_i = 0;
|
||||||
@ -957,11 +961,8 @@ static int __devinit abituguru3_probe(struct platform_device *pdev)
|
|||||||
for (i = 0; data->sensors[i].name; i++) {
|
for (i = 0; data->sensors[i].name; i++) {
|
||||||
/* Fail safe check, this should never happen! */
|
/* Fail safe check, this should never happen! */
|
||||||
if (i >= ABIT_UGURU3_MAX_NO_SENSORS) {
|
if (i >= ABIT_UGURU3_MAX_NO_SENSORS) {
|
||||||
printk(KERN_ERR ABIT_UGURU3_NAME
|
pr_err("Fatal error motherboard has more sensors then ABIT_UGURU3_MAX_NO_SENSORS. %s %s\n",
|
||||||
": Fatal error motherboard has more sensors "
|
never_happen, report_this);
|
||||||
"then ABIT_UGURU3_MAX_NO_SENSORS. This should "
|
|
||||||
"never happen please report to the abituguru3 "
|
|
||||||
"maintainer (see MAINTAINERS)\n");
|
|
||||||
res = -ENAMETOOLONG;
|
res = -ENAMETOOLONG;
|
||||||
goto abituguru3_probe_error;
|
goto abituguru3_probe_error;
|
||||||
}
|
}
|
||||||
@ -983,10 +984,8 @@ static int __devinit abituguru3_probe(struct platform_device *pdev)
|
|||||||
}
|
}
|
||||||
/* Fail safe check, this should never happen! */
|
/* Fail safe check, this should never happen! */
|
||||||
if (sysfs_names_free < 0) {
|
if (sysfs_names_free < 0) {
|
||||||
printk(KERN_ERR ABIT_UGURU3_NAME
|
pr_err("Fatal error ran out of space for sysfs attr names. %s %s\n",
|
||||||
": Fatal error ran out of space for sysfs attr names. "
|
never_happen, report_this);
|
||||||
"This should never happen please report to the "
|
|
||||||
"abituguru3 maintainer (see MAINTAINERS)\n");
|
|
||||||
res = -ENAMETOOLONG;
|
res = -ENAMETOOLONG;
|
||||||
goto abituguru3_probe_error;
|
goto abituguru3_probe_error;
|
||||||
}
|
}
|
||||||
@ -1189,8 +1188,7 @@ static int __init abituguru3_detect(void)
|
|||||||
"0x%02X\n", (unsigned int)data_val, (unsigned int)cmd_val);
|
"0x%02X\n", (unsigned int)data_val, (unsigned int)cmd_val);
|
||||||
|
|
||||||
if (force) {
|
if (force) {
|
||||||
printk(KERN_INFO ABIT_UGURU3_NAME ": Assuming Abit uGuru3 is "
|
pr_info("Assuming Abit uGuru3 is present because of \"force\" parameter\n");
|
||||||
"present because of \"force\" parameter\n");
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1219,10 +1217,8 @@ static int __init abituguru3_init(void)
|
|||||||
return err;
|
return err;
|
||||||
|
|
||||||
#ifdef CONFIG_DMI
|
#ifdef CONFIG_DMI
|
||||||
printk(KERN_WARNING ABIT_UGURU3_NAME ": this motherboard was "
|
pr_warn("this motherboard was not detected using DMI. "
|
||||||
"not detected using DMI. Please send the output of "
|
"Please send the output of \"dmidecode\" to the abituguru3 maintainer (see MAINTAINERS)\n");
|
||||||
"\"dmidecode\" to the abituguru3 maintainer "
|
|
||||||
"(see MAINTAINERS)\n");
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1233,8 +1229,7 @@ static int __init abituguru3_init(void)
|
|||||||
abituguru3_pdev = platform_device_alloc(ABIT_UGURU3_NAME,
|
abituguru3_pdev = platform_device_alloc(ABIT_UGURU3_NAME,
|
||||||
ABIT_UGURU3_BASE);
|
ABIT_UGURU3_BASE);
|
||||||
if (!abituguru3_pdev) {
|
if (!abituguru3_pdev) {
|
||||||
printk(KERN_ERR ABIT_UGURU3_NAME
|
pr_err("Device allocation failed\n");
|
||||||
": Device allocation failed\n");
|
|
||||||
err = -ENOMEM;
|
err = -ENOMEM;
|
||||||
goto exit_driver_unregister;
|
goto exit_driver_unregister;
|
||||||
}
|
}
|
||||||
@ -1245,15 +1240,13 @@ static int __init abituguru3_init(void)
|
|||||||
|
|
||||||
err = platform_device_add_resources(abituguru3_pdev, &res, 1);
|
err = platform_device_add_resources(abituguru3_pdev, &res, 1);
|
||||||
if (err) {
|
if (err) {
|
||||||
printk(KERN_ERR ABIT_UGURU3_NAME
|
pr_err("Device resource addition failed (%d)\n", err);
|
||||||
": Device resource addition failed (%d)\n", err);
|
|
||||||
goto exit_device_put;
|
goto exit_device_put;
|
||||||
}
|
}
|
||||||
|
|
||||||
err = platform_device_add(abituguru3_pdev);
|
err = platform_device_add(abituguru3_pdev);
|
||||||
if (err) {
|
if (err) {
|
||||||
printk(KERN_ERR ABIT_UGURU3_NAME
|
pr_err("Device addition failed (%d)\n", err);
|
||||||
": Device addition failed (%d)\n", err);
|
|
||||||
goto exit_device_put;
|
goto exit_device_put;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user