summaryrefslogtreecommitdiffstats
path: root/drivers/hwmon
diff options
context:
space:
mode:
authorAxel Lin <axel.lin@ingics.com>2014-07-01 04:55:55 +0200
committerGuenter Roeck <linux@roeck-us.net>2014-08-04 16:01:37 +0200
commit15ac4ddb3271af9471225ef018eb3907989aaf6a (patch)
tree9b043318d95c70d5278930a23303666a4e13fb7d /drivers/hwmon
parenthwmon: (adm9240) Convert to devm_hwmon_device_register_with_groups (diff)
downloadlinux-15ac4ddb3271af9471225ef018eb3907989aaf6a.tar.xz
linux-15ac4ddb3271af9471225ef018eb3907989aaf6a.zip
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')
-rw-r--r--drivers/hwmon/g760a.c35
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 @@
#include <linux/mutex.h>
#include <linux/sysfs.h>
-static const struct i2c_device_id g760a_id[] = {
- { "g760a", 0 },
- { }
-};
-MODULE_DEVICE_TABLE(i2c, g760a_id);
-
enum g760a_regs {
G760A_REG_SET_CNT = 0x00,
G760A_REG_ACT_CNT = 0x01,
@@ -74,20 +68,6 @@ static inline unsigned int rpm_from_cnt(u8 val, u32 clk, u16 div)
return ((val == 0x00) ? 0 : ((clk*30)/(val*div)));
}
-/* new-style driver model */
-static int g760a_probe(struct i2c_client *client,
- const struct i2c_device_id *id);
-static int g760a_remove(struct i2c_client *client);
-
-static struct i2c_driver g760a_driver = {
- .driver = {
- .name = "g760a",
- },
- .probe = g760a_probe,
- .remove = g760a_remove,
- .id_table = g760a_id,
-};
-
/* read/write wrappers */
static int g760a_read_value(struct i2c_client *client, enum g760a_regs reg)
{
@@ -247,6 +227,21 @@ static int g760a_remove(struct i2c_client *client)
return 0;
}
+static const struct i2c_device_id g760a_id[] = {
+ { "g760a", 0 },
+ { }
+};
+MODULE_DEVICE_TABLE(i2c, g760a_id);
+
+static struct i2c_driver g760a_driver = {
+ .driver = {
+ .name = "g760a",
+ },
+ .probe = g760a_probe,
+ .remove = g760a_remove,
+ .id_table = g760a_id,
+};
+
module_i2c_driver(g760a_driver);
MODULE_AUTHOR("Herbert Valerio Riedel <hvr@gnu.org>");