diff options
author | Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> | 2012-10-19 21:19:19 +0200 |
---|---|---|
committer | Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> | 2012-10-19 21:19:19 +0200 |
commit | e05dacd71db0a5da7c1a44bcaab2a8a240b9c233 (patch) | |
tree | 31382cf1c7d62c03126448affb2fc86e8c4aaa8b /drivers/hwmon/sch56xx-common.c | |
parent | xen: arm: comment on why 64-bit xen_pfn_t is safe even on 32 bit (diff) | |
parent | Linux 3.7-rc1 (diff) | |
download | linux-e05dacd71db0a5da7c1a44bcaab2a8a240b9c233.tar.xz linux-e05dacd71db0a5da7c1a44bcaab2a8a240b9c233.zip |
Merge commit 'v3.7-rc1' into stable/for-linus-3.7
* commit 'v3.7-rc1': (10892 commits)
Linux 3.7-rc1
x86, boot: Explicitly include autoconf.h for hostprogs
perf: Fix UAPI fallout
ARM: config: make sure that platforms are ordered by option string
ARM: config: sort select statements alphanumerically
UAPI: (Scripted) Disintegrate include/linux/byteorder
UAPI: (Scripted) Disintegrate include/linux
UAPI: Unexport linux/blk_types.h
UAPI: Unexport part of linux/ppp-comp.h
perf: Handle new rbtree implementation
procfs: don't need a PATH_MAX allocation to hold a string representation of an int
vfs: embed struct filename inside of names_cache allocation if possible
audit: make audit_inode take struct filename
vfs: make path_openat take a struct filename pointer
vfs: turn do_path_lookup into wrapper around struct filename variant
audit: allow audit code to satisfy getname requests from its names_list
vfs: define struct filename and have getname() return it
btrfs: Fix compilation with user namespace support enabled
userns: Fix posix_acl_file_xattr_userns gid conversion
userns: Properly print bluetooth socket uids
...
Diffstat (limited to 'drivers/hwmon/sch56xx-common.c')
-rw-r--r-- | drivers/hwmon/sch56xx-common.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/drivers/hwmon/sch56xx-common.c b/drivers/hwmon/sch56xx-common.c index 4380f5d07be2..d00b30adc34b 100644 --- a/drivers/hwmon/sch56xx-common.c +++ b/drivers/hwmon/sch56xx-common.c @@ -503,10 +503,10 @@ EXPORT_SYMBOL(sch56xx_watchdog_unregister); * platform dev find, add and remove functions */ -static int __init sch56xx_find(int sioaddr, unsigned short *address, - const char **name) +static int __init sch56xx_find(int sioaddr, const char **name) { u8 devid; + unsigned short address; int err; err = superio_enter(sioaddr); @@ -540,20 +540,21 @@ static int __init sch56xx_find(int sioaddr, unsigned short *address, * Warning the order of the low / high byte is the other way around * as on most other superio devices!! */ - *address = superio_inb(sioaddr, SIO_REG_ADDR) | + address = superio_inb(sioaddr, SIO_REG_ADDR) | superio_inb(sioaddr, SIO_REG_ADDR + 1) << 8; - if (*address == 0) { + if (address == 0) { pr_warn("Base address not set\n"); err = -ENODEV; goto exit; } + err = address; exit: superio_exit(sioaddr); return err; } -static int __init sch56xx_device_add(unsigned short address, const char *name) +static int __init sch56xx_device_add(int address, const char *name) { struct resource res = { .start = address, @@ -593,15 +594,14 @@ exit_device_put: static int __init sch56xx_init(void) { - int err; - unsigned short address; - const char *name; - - err = sch56xx_find(0x4e, &address, &name); - if (err) - err = sch56xx_find(0x2e, &address, &name); - if (err) - return err; + int address; + const char *name = NULL; + + address = sch56xx_find(0x4e, &name); + if (address < 0) + address = sch56xx_find(0x2e, &name); + if (address < 0) + return address; return sch56xx_device_add(address, name); } |