lkml.org 
[lkml]   [2010]   [Mar]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 2/4] hwmon: f71882fg: prepare for addition of watchdog support
Date
Rename the `address' variable that's used in some places to hwmon_addr
to indicate it refers to the hardware monitor (HWMON in datasheet)
"logical device" of the chip.

Signed-off-by: Giel van Schijndel <me@mortis.eu>
---
drivers/hwmon/f71882fg.c | 24 ++++++++++++------------
1 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/drivers/hwmon/f71882fg.c b/drivers/hwmon/f71882fg.c
index b290b87..7b31e14 100644
--- a/drivers/hwmon/f71882fg.c
+++ b/drivers/hwmon/f71882fg.c
@@ -2233,7 +2233,7 @@ static int f71882fg_remove(struct platform_device *pdev)
return 0;
}

-static int __init f71882fg_find(int sioaddr, unsigned short *address,
+static int __init f71882fg_find(int sioaddr, unsigned short *hwmon_addr,
struct f71882fg_sio_data *sio_data)
{
int err = -ENODEV;
@@ -2290,16 +2290,16 @@ static int __init f71882fg_find(int sioaddr, unsigned short *address,
goto exit;
}

- *address = superio_inw(sioaddr, SIO_REG_ADDR);
- if (*address == 0) {
+ *hwmon_addr = superio_inw(sioaddr, SIO_REG_ADDR);
+ if (*hwmon_addr == 0) {
printk(KERN_WARNING DRVNAME ": Base address not set\n");
goto exit;
}
- *address &= ~(REGION_LENGTH - 1); /* Ignore 3 LSB */
+ *hwmon_addr &= ~(REGION_LENGTH - 1); /* Ignore 3 LSB */

err = 0;
printk(KERN_INFO DRVNAME ": Found %s chip at %#x, revision %d\n",
- f71882fg_names[sio_data->type], (unsigned int)*address,
+ f71882fg_names[sio_data->type], (unsigned int)*hwmon_addr,
(int)superio_inb(sioaddr, SIO_REG_DEVREV));
exit:
superio_exit(sioaddr);
@@ -2307,17 +2307,17 @@ exit:
return err;
}

-static int __init f71882fg_device_add(unsigned short address,
+static int __init f71882fg_device_add(unsigned short hwmon_addr,
const struct f71882fg_sio_data *sio_data)
{
struct resource res = {
- .start = address,
- .end = address + REGION_LENGTH - 1,
+ .start = hwmon_addr,
+ .end = hwmon_addr + REGION_LENGTH - 1,
.flags = IORESOURCE_IO,
};
int err;

- f71882fg_pdev = platform_device_alloc(DRVNAME, address);
+ f71882fg_pdev = platform_device_alloc(DRVNAME, hwmon_addr);
if (!f71882fg_pdev)
return -ENOMEM;

@@ -2357,14 +2357,14 @@ static int __init f71882fg_init(void)
{
static const unsigned short addrs[] = { 0x2e, 0x4e };
int err = -ENODEV;
- unsigned short address = /* shut up compiler */ 0;
+ unsigned short hwmon_addr = /* shut up compiler */ 0;
struct f71882fg_sio_data sio_data;
int i;

memset(&sio_data, 0, sizeof(sio_data));

for (i = 0; i < ARRAY_SIZE(addrs); i++) {
- err = f71882fg_find(addrs[i], &address, &sio_data);
+ err = f71882fg_find(addrs[i], &hwmon_addr, &sio_data);
if (err == 0)
break;
}
@@ -2375,7 +2375,7 @@ static int __init f71882fg_init(void)
if (err)
goto exit;

- err = f71882fg_device_add(address, &sio_data);
+ err = f71882fg_device_add(hwmon_addr, &sio_data);
if (err)
goto exit_driver;

--
1.6.4.4


\
 
 \ /
  Last update: 2010-03-24 00:15    [W:0.149 / U:1.924 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site