~ubuntu-branches/debian/wheezy/linux-2.6/wheezy

« back to all changes in this revision

Viewing changes to drivers/hwmon/abituguru.c

  • Committer: Bazaar Package Importer
  • Author(s): Ben Hutchings, Ben Hutchings, Aurelien Jarno, Martin Michlmayr
  • Date: 2011-04-06 13:53:30 UTC
  • mfrom: (43.1.5 sid)
  • Revision ID: james.westby@ubuntu.com-20110406135330-wjufxhd0tvn3zx4z
Tags: 2.6.38-3
[ Ben Hutchings ]
* [ppc64] Add to linux-tools package architectures (Closes: #620124)
* [amd64] Save cr4 to mmu_cr4_features at boot time (Closes: #620284)
* appletalk: Fix bugs introduced when removing use of BKL
* ALSA: Fix yet another race in disconnection
* cciss: Fix lost command issue
* ath9k: Fix kernel panic in AR2427
* ses: Avoid kernel panic when lun 0 is not mapped
* PCI/ACPI: Report ASPM support to BIOS if not disabled from command line

[ Aurelien Jarno ]
* rtlwifi: fix build when PCI is not enabled.

[ Martin Michlmayr ]
* rtlwifi: Eliminate udelay calls with too large values (Closes: #620204)

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
    the custom Abit uGuru chip found on Abit uGuru motherboards. Note: because
21
21
    of lack of specs the CPU/RAM voltage & frequency control is not supported!
22
22
*/
 
23
 
 
24
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
 
25
 
23
26
#include <linux/module.h>
24
27
#include <linux/sched.h>
25
28
#include <linux/init.h>
220
223
        u8 pwm_settings[ABIT_UGURU_MAX_PWMS][5];
221
224
};
222
225
 
 
226
static const char *never_happen = "This should never happen.";
 
227
static const char *report_this =
 
228
        "Please report this to the abituguru maintainer (see MAINTAINERS)";
 
229
 
223
230
/* wait till the uguru is in the specified state */
224
231
static int abituguru_wait(struct abituguru_data *data, u8 state)
225
232
{
438
445
 
439
446
        /* Test val is sane / usable for sensor type detection. */
440
447
        if ((val < 10u) || (val > 250u)) {
441
 
                printk(KERN_WARNING ABIT_UGURU_NAME
442
 
                        ": bank1-sensor: %d reading (%d) too close to limits, "
 
448
                pr_warn("bank1-sensor: %d reading (%d) too close to limits, "
443
449
                        "unable to determine sensor type, skipping sensor\n",
444
450
                        (int)sensor_addr, (int)val);
445
451
                /* assume no sensor is there for sensors for which we can't
535
541
                                3) == 3)
536
542
                        break;
537
543
        if (i == 3) {
538
 
                printk(KERN_ERR ABIT_UGURU_NAME
539
 
                        ": Fatal error could not restore original settings. "
540
 
                        "This should never happen please report this to the "
541
 
                        "abituguru maintainer (see MAINTAINERS)\n");
 
544
                pr_err("Fatal error could not restore original settings. %s %s\n",
 
545
                       never_happen, report_this);
542
546
                return -ENODEV;
543
547
        }
544
548
        return ret;
1268
1272
        }
1269
1273
        /* Fail safe check, this should never happen! */
1270
1274
        if (sysfs_names_free < 0) {
1271
 
                printk(KERN_ERR ABIT_UGURU_NAME ": Fatal error ran out of "
1272
 
                       "space for sysfs attr names. This should never "
1273
 
                       "happen please report to the abituguru maintainer "
1274
 
                       "(see MAINTAINERS)\n");
 
1275
                pr_err("Fatal error ran out of space for sysfs attr names. %s %s",
 
1276
                       never_happen, report_this);
1275
1277
                res = -ENAMETOOLONG;
1276
1278
                goto abituguru_probe_error;
1277
1279
        }
1278
 
        printk(KERN_INFO ABIT_UGURU_NAME ": found Abit uGuru\n");
 
1280
        pr_info("found Abit uGuru\n");
1279
1281
 
1280
1282
        /* Register sysfs hooks */
1281
1283
        for (i = 0; i < sysfs_attr_i; i++)
1432
1434
                "0x%02X\n", (unsigned int)data_val, (unsigned int)cmd_val);
1433
1435
 
1434
1436
        if (force) {
1435
 
                printk(KERN_INFO ABIT_UGURU_NAME ": Assuming Abit uGuru is "
1436
 
                                "present because of \"force\" parameter\n");
 
1437
                pr_info("Assuming Abit uGuru is present because of \"force\" parameter\n");
1437
1438
                return ABIT_UGURU_BASE;
1438
1439
        }
1439
1440
 
1467
1468
 
1468
1469
        abituguru_pdev = platform_device_alloc(ABIT_UGURU_NAME, address);
1469
1470
        if (!abituguru_pdev) {
1470
 
                printk(KERN_ERR ABIT_UGURU_NAME
1471
 
                        ": Device allocation failed\n");
 
1471
                pr_err("Device allocation failed\n");
1472
1472
                err = -ENOMEM;
1473
1473
                goto exit_driver_unregister;
1474
1474
        }
1479
1479
 
1480
1480
        err = platform_device_add_resources(abituguru_pdev, &res, 1);
1481
1481
        if (err) {
1482
 
                printk(KERN_ERR ABIT_UGURU_NAME
1483
 
                        ": Device resource addition failed (%d)\n", err);
 
1482
                pr_err("Device resource addition failed (%d)\n", err);
1484
1483
                goto exit_device_put;
1485
1484
        }
1486
1485
 
1487
1486
        err = platform_device_add(abituguru_pdev);
1488
1487
        if (err) {
1489
 
                printk(KERN_ERR ABIT_UGURU_NAME
1490
 
                        ": Device addition failed (%d)\n", err);
 
1488
                pr_err("Device addition failed (%d)\n", err);
1491
1489
                goto exit_device_put;
1492
1490
        }
1493
1491