diff options
-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); | |||
503 | * platform dev find, add and remove functions | 503 | * platform dev find, add and remove functions |
504 | */ | 504 | */ |
505 | 505 | ||
506 | static int __init sch56xx_find(int sioaddr, unsigned short *address, | 506 | static int __init sch56xx_find(int sioaddr, const char **name) |
507 | const char **name) | ||
508 | { | 507 | { |
509 | u8 devid; | 508 | u8 devid; |
509 | unsigned short address; | ||
510 | int err; | 510 | int err; |
511 | 511 | ||
512 | err = superio_enter(sioaddr); | 512 | err = superio_enter(sioaddr); |
@@ -540,20 +540,21 @@ static int __init sch56xx_find(int sioaddr, unsigned short *address, | |||
540 | * Warning the order of the low / high byte is the other way around | 540 | * Warning the order of the low / high byte is the other way around |
541 | * as on most other superio devices!! | 541 | * as on most other superio devices!! |
542 | */ | 542 | */ |
543 | *address = superio_inb(sioaddr, SIO_REG_ADDR) | | 543 | address = superio_inb(sioaddr, SIO_REG_ADDR) | |
544 | superio_inb(sioaddr, SIO_REG_ADDR + 1) << 8; | 544 | superio_inb(sioaddr, SIO_REG_ADDR + 1) << 8; |
545 | if (*address == 0) { | 545 | if (address == 0) { |
546 | pr_warn("Base address not set\n"); | 546 | pr_warn("Base address not set\n"); |
547 | err = -ENODEV; | 547 | err = -ENODEV; |
548 | goto exit; | 548 | goto exit; |
549 | } | 549 | } |
550 | err = address; | ||
550 | 551 | ||
551 | exit: | 552 | exit: |
552 | superio_exit(sioaddr); | 553 | superio_exit(sioaddr); |
553 | return err; | 554 | return err; |
554 | } | 555 | } |
555 | 556 | ||
556 | static int __init sch56xx_device_add(unsigned short address, const char *name) | 557 | static int __init sch56xx_device_add(int address, const char *name) |
557 | { | 558 | { |
558 | struct resource res = { | 559 | struct resource res = { |
559 | .start = address, | 560 | .start = address, |
@@ -593,15 +594,14 @@ exit_device_put: | |||
593 | 594 | ||
594 | static int __init sch56xx_init(void) | 595 | static int __init sch56xx_init(void) |
595 | { | 596 | { |
596 | int err; | 597 | int address; |
597 | unsigned short address; | 598 | const char *name = NULL; |
598 | const char *name; | 599 | |
599 | 600 | address = sch56xx_find(0x4e, &name); | |
600 | err = sch56xx_find(0x4e, &address, &name); | 601 | if (address < 0) |
601 | if (err) | 602 | address = sch56xx_find(0x2e, &name); |
602 | err = sch56xx_find(0x2e, &address, &name); | 603 | if (address < 0) |
603 | if (err) | 604 | return address; |
604 | return err; | ||
605 | 605 | ||
606 | return sch56xx_device_add(address, name); | 606 | return sch56xx_device_add(address, name); |
607 | } | 607 | } |