Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 299179
b: refs/heads/master
c: 1d0045e
h: refs/heads/master
i:
  299177: 39e2755
  299175: 004df1f
v: v3
  • Loading branch information
Guenter Roeck authored and Guenter Roeck committed Apr 9, 2012
1 parent 651266b commit cd518a0
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 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: 776cdc11b3b0fc21e34600e22abe1c8209d2f3f0
refs/heads/master: 1d0045ee4a220872b65147b5b290e4a4852386d9
19 changes: 10 additions & 9 deletions trunk/drivers/hwmon/smsc47m1.c
Original file line number Diff line number Diff line change
Expand Up @@ -491,10 +491,10 @@ static const struct attribute_group smsc47m1_group = {
.attrs = smsc47m1_attributes,
};

static int __init smsc47m1_find(unsigned short *addr,
struct smsc47m1_sio_data *sio_data)
static int __init smsc47m1_find(struct smsc47m1_sio_data *sio_data)
{
u8 val;
unsigned short addr;

superio_enter();
val = force_id ? force_id : superio_inb(SUPERIO_REG_DEVID);
Expand Down Expand Up @@ -546,9 +546,9 @@ static int __init smsc47m1_find(unsigned short *addr,
}

superio_select();
*addr = (superio_inb(SUPERIO_REG_BASE) << 8)
addr = (superio_inb(SUPERIO_REG_BASE) << 8)
| superio_inb(SUPERIO_REG_BASE + 1);
if (*addr == 0) {
if (addr == 0) {
pr_info("Device address not set, will not use\n");
superio_exit();
return -ENODEV;
Expand All @@ -565,7 +565,7 @@ static int __init smsc47m1_find(unsigned short *addr,
}

superio_exit();
return 0;
return addr;
}

/* Restore device to its initial state */
Expand Down Expand Up @@ -938,13 +938,15 @@ static int __init sm_smsc47m1_init(void)
unsigned short address;
struct smsc47m1_sio_data sio_data;

if (smsc47m1_find(&address, &sio_data))
return -ENODEV;
err = smsc47m1_find(&sio_data);
if (err < 0)
return err;
address = err;

/* Sets global pdev as a side effect */
err = smsc47m1_device_add(address, &sio_data);
if (err)
goto exit;
return err;

err = platform_driver_probe(&smsc47m1_driver, smsc47m1_probe);
if (err)
Expand All @@ -955,7 +957,6 @@ static int __init sm_smsc47m1_init(void)
exit_device:
platform_device_unregister(pdev);
smsc47m1_restore(&sio_data);
exit:
return err;
}

Expand Down

0 comments on commit cd518a0

Please sign in to comment.