Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 326149
b: refs/heads/master
c: 313829e
h: refs/heads/master
i:
  326147: 8792d8c
v: v3
  • Loading branch information
Guenter Roeck committed Sep 24, 2012
1 parent c6ce0a3 commit 66fefe2
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 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: 0038389add7388954d74985ce7e631076216cf02
refs/heads/master: 313829ee3cccbc658409357f32a1508620b60142
28 changes: 14 additions & 14 deletions trunk/drivers/hwmon/sch56xx-common.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -593,15 +594,14 @@ static int __init sch56xx_device_add(unsigned short address, const char *name)

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);
}
Expand Down

0 comments on commit 66fefe2

Please sign in to comment.