diff options
author | Axel Lin <axel.lin@ingics.com> | 2014-06-30 22:55:55 -0400 |
---|---|---|
committer | Guenter Roeck <linux@roeck-us.net> | 2014-08-04 10:01:37 -0400 |
commit | 15ac4ddb3271af9471225ef018eb3907989aaf6a (patch) | |
tree | 9b043318d95c70d5278930a23303666a4e13fb7d /drivers/hwmon/g760a.c | |
parent | 715f69bef14e4139ff1e19bbc69e0cd07de0f4e9 (diff) |
hwmon: (g760a) Avoid forward declaration
Move g760a_driver to proper place to avoid forward declaration.
Also move g760a_id table close to g760a_driver.
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Diffstat (limited to 'drivers/hwmon/g760a.c')
-rw-r--r-- | drivers/hwmon/g760a.c | 35 |
1 files changed, 15 insertions, 20 deletions
diff --git a/drivers/hwmon/g760a.c b/drivers/hwmon/g760a.c index ea6480b80e7f..8460f8062efc 100644 --- a/drivers/hwmon/g760a.c +++ b/drivers/hwmon/g760a.c | |||
@@ -24,12 +24,6 @@ | |||
24 | #include <linux/mutex.h> | 24 | #include <linux/mutex.h> |
25 | #include <linux/sysfs.h> | 25 | #include <linux/sysfs.h> |
26 | 26 | ||
27 | static const struct i2c_device_id g760a_id[] = { | ||
28 | { "g760a", 0 }, | ||
29 | { } | ||
30 | }; | ||
31 | MODULE_DEVICE_TABLE(i2c, g760a_id); | ||
32 | |||
33 | enum g760a_regs { | 27 | enum g760a_regs { |
34 | G760A_REG_SET_CNT = 0x00, | 28 | G760A_REG_SET_CNT = 0x00, |
35 | G760A_REG_ACT_CNT = 0x01, | 29 | G760A_REG_ACT_CNT = 0x01, |
@@ -74,20 +68,6 @@ static inline unsigned int rpm_from_cnt(u8 val, u32 clk, u16 div) | |||
74 | return ((val == 0x00) ? 0 : ((clk*30)/(val*div))); | 68 | return ((val == 0x00) ? 0 : ((clk*30)/(val*div))); |
75 | } | 69 | } |
76 | 70 | ||
77 | /* new-style driver model */ | ||
78 | static int g760a_probe(struct i2c_client *client, | ||
79 | const struct i2c_device_id *id); | ||
80 | static int g760a_remove(struct i2c_client *client); | ||
81 | |||
82 | static struct i2c_driver g760a_driver = { | ||
83 | .driver = { | ||
84 | .name = "g760a", | ||
85 | }, | ||
86 | .probe = g760a_probe, | ||
87 | .remove = g760a_remove, | ||
88 | .id_table = g760a_id, | ||
89 | }; | ||
90 | |||
91 | /* read/write wrappers */ | 71 | /* read/write wrappers */ |
92 | static int g760a_read_value(struct i2c_client *client, enum g760a_regs reg) | 72 | static int g760a_read_value(struct i2c_client *client, enum g760a_regs reg) |
93 | { | 73 | { |
@@ -247,6 +227,21 @@ static int g760a_remove(struct i2c_client *client) | |||
247 | return 0; | 227 | return 0; |
248 | } | 228 | } |
249 | 229 | ||
230 | static const struct i2c_device_id g760a_id[] = { | ||
231 | { "g760a", 0 }, | ||
232 | { } | ||
233 | }; | ||
234 | MODULE_DEVICE_TABLE(i2c, g760a_id); | ||
235 | |||
236 | static struct i2c_driver g760a_driver = { | ||
237 | .driver = { | ||
238 | .name = "g760a", | ||
239 | }, | ||
240 | .probe = g760a_probe, | ||
241 | .remove = g760a_remove, | ||
242 | .id_table = g760a_id, | ||
243 | }; | ||
244 | |||
250 | module_i2c_driver(g760a_driver); | 245 | module_i2c_driver(g760a_driver); |
251 | 246 | ||
252 | MODULE_AUTHOR("Herbert Valerio Riedel <hvr@gnu.org>"); | 247 | MODULE_AUTHOR("Herbert Valerio Riedel <hvr@gnu.org>"); |