All of lore.kernel.org
 help / color / mirror / Atom feed
* [lm-sensors] [RFT][PATCH 1/2] hwmon: (g760a) Avoid forward declaration
@ 2014-07-01  2:55 Axel Lin
  2014-07-01 18:35 ` Guenter Roeck
  0 siblings, 1 reply; 2+ messages in thread
From: Axel Lin @ 2014-07-01  2:55 UTC (permalink / raw)
  To: lm-sensors

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>
---
 drivers/hwmon/g760a.c | 35 +++++++++++++++--------------------
 1 file changed, 15 insertions(+), 20 deletions(-)

diff --git a/drivers/hwmon/g760a.c b/drivers/hwmon/g760a.c
index ea6480b..8460f80 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>");
-- 
1.9.1




_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [lm-sensors] [RFT][PATCH 1/2] hwmon: (g760a) Avoid forward declaration
  2014-07-01  2:55 [lm-sensors] [RFT][PATCH 1/2] hwmon: (g760a) Avoid forward declaration Axel Lin
@ 2014-07-01 18:35 ` Guenter Roeck
  0 siblings, 0 replies; 2+ messages in thread
From: Guenter Roeck @ 2014-07-01 18:35 UTC (permalink / raw)
  To: lm-sensors

On 06/30/2014 07:55 PM, Axel Lin wrote:
> 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>

Applied to -next.

Thanks,
Guenter



_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-07-01 18:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-01  2:55 [lm-sensors] [RFT][PATCH 1/2] hwmon: (g760a) Avoid forward declaration Axel Lin
2014-07-01 18:35 ` Guenter Roeck

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.