Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 227758
b: refs/heads/master
c: 5ed9ba6
h: refs/heads/master
v: v3
  • Loading branch information
Joe Perches authored and Guenter Roeck committed Jan 8, 2011
1 parent d4934cc commit ab91bc1
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 18 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 774f7827e13cfae720306ca44b83b93ab2a6b9be
refs/heads/master: 5ed9ba6b87545d21b48e50a028bfb79f9812f89f
30 changes: 13 additions & 17 deletions trunk/drivers/hwmon/vt1211.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/

#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt

#include <linux/module.h>
#include <linux/init.h>
#include <linux/slab.h>
Expand Down Expand Up @@ -1254,8 +1256,7 @@ static int __init vt1211_device_add(unsigned short address)
pdev = platform_device_alloc(DRVNAME, address);
if (!pdev) {
err = -ENOMEM;
printk(KERN_ERR DRVNAME ": Device allocation failed (%d)\n",
err);
pr_err("Device allocation failed (%d)\n", err);
goto EXIT;
}

Expand All @@ -1266,15 +1267,13 @@ static int __init vt1211_device_add(unsigned short address)

err = platform_device_add_resources(pdev, &res, 1);
if (err) {
printk(KERN_ERR DRVNAME ": Device resource addition failed "
"(%d)\n", err);
pr_err("Device resource addition failed (%d)\n", err);
goto EXIT_DEV_PUT;
}

err = platform_device_add(pdev);
if (err) {
printk(KERN_ERR DRVNAME ": Device addition failed (%d)\n",
err);
pr_err("Device addition failed (%d)\n", err);
goto EXIT_DEV_PUT;
}

Expand All @@ -1301,23 +1300,20 @@ static int __init vt1211_find(int sio_cip, unsigned short *address)
superio_select(sio_cip, SIO_VT1211_LDN_HWMON);

if ((superio_inb(sio_cip, SIO_VT1211_ACTIVE) & 1) == 0) {
printk(KERN_WARNING DRVNAME ": HW monitor is disabled, "
"skipping\n");
pr_warn("HW monitor is disabled, skipping\n");
goto EXIT;
}

*address = ((superio_inb(sio_cip, SIO_VT1211_BADDR) << 8) |
(superio_inb(sio_cip, SIO_VT1211_BADDR + 1))) & 0xff00;
if (*address == 0) {
printk(KERN_WARNING DRVNAME ": Base address is not set, "
"skipping\n");
pr_warn("Base address is not set, skipping\n");
goto EXIT;
}

err = 0;
printk(KERN_INFO DRVNAME ": Found VT1211 chip at 0x%04x, "
"revision %u\n", *address,
superio_inb(sio_cip, SIO_VT1211_DEVREV));
pr_info("Found VT1211 chip at 0x%04x, revision %u\n",
*address, superio_inb(sio_cip, SIO_VT1211_DEVREV));

EXIT:
superio_exit(sio_cip);
Expand All @@ -1336,15 +1332,15 @@ static int __init vt1211_init(void)

if ((uch_config < -1) || (uch_config > 31)) {
err = -EINVAL;
printk(KERN_WARNING DRVNAME ": Invalid UCH configuration %d. "
"Choose a value between 0 and 31.\n", uch_config);
pr_warn("Invalid UCH configuration %d. "
"Choose a value between 0 and 31.\n", uch_config);
goto EXIT;
}

if ((int_mode < -1) || (int_mode > 0)) {
err = -EINVAL;
printk(KERN_WARNING DRVNAME ": Invalid interrupt mode %d. "
"Only mode 0 is supported.\n", int_mode);
pr_warn("Invalid interrupt mode %d. "
"Only mode 0 is supported.\n", int_mode);
goto EXIT;
}

Expand Down

0 comments on commit ab91bc1

Please sign in to comment.