diff options
author | Guenter Roeck <linux@roeck-us.net> | 2015-03-28 10:49:14 -0400 |
---|---|---|
committer | Guenter Roeck <linux@roeck-us.net> | 2016-04-19 09:32:36 -0400 |
commit | 8e50e3c3f60c84b96956d37cbbf109b75569c6ba (patch) | |
tree | e01af634d0b4273253a7598d2b7acfcd50a6e6ca /drivers/hwmon | |
parent | 5cae84a58ee60eb54f636133f4f3ede9af93d476 (diff) |
hwmon: (it87) Don't use pdev as static driver variable
Using the same varible name for function names and as static
variable invites misuse and prevents us from adding support
for a second chip. Rename pdev to it87_pdev and limit its use
to where it is needed.
Tested-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Diffstat (limited to 'drivers/hwmon')
-rw-r--r-- | drivers/hwmon/it87.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/hwmon/it87.c b/drivers/hwmon/it87.c index 9b36987d7949..8f28f9b04150 100644 --- a/drivers/hwmon/it87.c +++ b/drivers/hwmon/it87.c | |||
@@ -78,7 +78,7 @@ static unsigned short force_id; | |||
78 | module_param(force_id, ushort, 0); | 78 | module_param(force_id, ushort, 0); |
79 | MODULE_PARM_DESC(force_id, "Override the detected device ID"); | 79 | MODULE_PARM_DESC(force_id, "Override the detected device ID"); |
80 | 80 | ||
81 | static struct platform_device *pdev; | 81 | static struct platform_device *it87_pdev; |
82 | 82 | ||
83 | #define REG 0x2e /* The register to read/write */ | 83 | #define REG 0x2e /* The register to read/write */ |
84 | #define DEV 0x07 /* Register: Logical device select */ | 84 | #define DEV 0x07 /* Register: Logical device select */ |
@@ -2285,7 +2285,7 @@ exit: | |||
2285 | 2285 | ||
2286 | static void it87_remove_files(struct device *dev) | 2286 | static void it87_remove_files(struct device *dev) |
2287 | { | 2287 | { |
2288 | struct it87_data *data = platform_get_drvdata(pdev); | 2288 | struct it87_data *data = dev_get_drvdata(dev); |
2289 | struct it87_sio_data *sio_data = dev_get_platdata(dev); | 2289 | struct it87_sio_data *sio_data = dev_get_platdata(dev); |
2290 | int i; | 2290 | int i; |
2291 | 2291 | ||
@@ -2888,6 +2888,7 @@ static struct it87_data *it87_update_device(struct device *dev) | |||
2888 | static int __init it87_device_add(unsigned short address, | 2888 | static int __init it87_device_add(unsigned short address, |
2889 | const struct it87_sio_data *sio_data) | 2889 | const struct it87_sio_data *sio_data) |
2890 | { | 2890 | { |
2891 | struct platform_device *pdev; | ||
2891 | struct resource res = { | 2892 | struct resource res = { |
2892 | .start = address + IT87_EC_OFFSET, | 2893 | .start = address + IT87_EC_OFFSET, |
2893 | .end = address + IT87_EC_OFFSET + IT87_EC_EXTENT - 1, | 2894 | .end = address + IT87_EC_OFFSET + IT87_EC_EXTENT - 1, |
@@ -2923,6 +2924,7 @@ static int __init it87_device_add(unsigned short address, | |||
2923 | goto exit_device_put; | 2924 | goto exit_device_put; |
2924 | } | 2925 | } |
2925 | 2926 | ||
2927 | it87_pdev = pdev; | ||
2926 | return 0; | 2928 | return 0; |
2927 | 2929 | ||
2928 | exit_device_put: | 2930 | exit_device_put: |
@@ -2955,7 +2957,7 @@ static int __init sm_it87_init(void) | |||
2955 | 2957 | ||
2956 | static void __exit sm_it87_exit(void) | 2958 | static void __exit sm_it87_exit(void) |
2957 | { | 2959 | { |
2958 | platform_device_unregister(pdev); | 2960 | platform_device_unregister(it87_pdev); |
2959 | platform_driver_unregister(&it87_driver); | 2961 | platform_driver_unregister(&it87_driver); |
2960 | } | 2962 | } |
2961 | 2963 | ||