aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/w1
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/w1')
-rw-r--r--drivers/w1/masters/Kconfig2
-rw-r--r--drivers/w1/masters/ds1wm.c1
-rw-r--r--drivers/w1/masters/ds2482.c37
-rw-r--r--drivers/w1/masters/ds2490.c1
-rw-r--r--drivers/w1/masters/mxc_w1.c5
-rw-r--r--drivers/w1/masters/omap_hdq.c7
-rw-r--r--drivers/w1/masters/w1-gpio.c1
-rw-r--r--drivers/w1/slaves/w1_ds2431.c4
-rw-r--r--drivers/w1/slaves/w1_ds2433.c5
-rw-r--r--drivers/w1/slaves/w1_ds2760.c33
-rw-r--r--drivers/w1/slaves/w1_ds2760.h7
-rw-r--r--drivers/w1/slaves/w1_therm.c5
-rw-r--r--drivers/w1/w1.c16
-rw-r--r--drivers/w1/w1_int.c1
-rw-r--r--drivers/w1/w1_netlink.c4
15 files changed, 75 insertions, 54 deletions
diff --git a/drivers/w1/masters/Kconfig b/drivers/w1/masters/Kconfig
index 3195fb8b7d9a..80b3b123dd7f 100644
--- a/drivers/w1/masters/Kconfig
+++ b/drivers/w1/masters/Kconfig
@@ -60,7 +60,7 @@ config W1_MASTER_GPIO
60 60
61config HDQ_MASTER_OMAP 61config HDQ_MASTER_OMAP
62 tristate "OMAP HDQ driver" 62 tristate "OMAP HDQ driver"
63 depends on ARCH_OMAP2430 || ARCH_OMAP34XX 63 depends on ARCH_OMAP2430 || ARCH_OMAP3
64 help 64 help
65 Say Y here if you want support for the 1-wire or HDQ Interface 65 Say Y here if you want support for the 1-wire or HDQ Interface
66 on an OMAP processor. 66 on an OMAP processor.
diff --git a/drivers/w1/masters/ds1wm.c b/drivers/w1/masters/ds1wm.c
index 37f08c850608..6b85e7fefa43 100644
--- a/drivers/w1/masters/ds1wm.c
+++ b/drivers/w1/masters/ds1wm.c
@@ -20,6 +20,7 @@
20#include <linux/delay.h> 20#include <linux/delay.h>
21#include <linux/mfd/core.h> 21#include <linux/mfd/core.h>
22#include <linux/mfd/ds1wm.h> 22#include <linux/mfd/ds1wm.h>
23#include <linux/slab.h>
23 24
24#include <asm/io.h> 25#include <asm/io.h>
25 26
diff --git a/drivers/w1/masters/ds2482.c b/drivers/w1/masters/ds2482.c
index df52cb355f7d..e5f74416d4b7 100644
--- a/drivers/w1/masters/ds2482.c
+++ b/drivers/w1/masters/ds2482.c
@@ -24,19 +24,6 @@
24#include "../w1_int.h" 24#include "../w1_int.h"
25 25
26/** 26/**
27 * Address is selected using 2 pins, resulting in 4 possible addresses.
28 * 0x18, 0x19, 0x1a, 0x1b
29 * However, the chip cannot be detected without doing an i2c write,
30 * so use the force module parameter.
31 */
32static const unsigned short normal_i2c[] = { I2C_CLIENT_END };
33
34/**
35 * Insmod parameters
36 */
37I2C_CLIENT_INSMOD_1(ds2482);
38
39/**
40 * The DS2482 registers - there are 3 registers that are addressed by a read 27 * The DS2482 registers - there are 3 registers that are addressed by a read
41 * pointer. The read pointer is set by the last command executed. 28 * pointer. The read pointer is set by the last command executed.
42 * 29 *
@@ -96,8 +83,6 @@ static const u8 ds2482_chan_rd[8] =
96 83
97static int ds2482_probe(struct i2c_client *client, 84static int ds2482_probe(struct i2c_client *client,
98 const struct i2c_device_id *id); 85 const struct i2c_device_id *id);
99static int ds2482_detect(struct i2c_client *client, int kind,
100 struct i2c_board_info *info);
101static int ds2482_remove(struct i2c_client *client); 86static int ds2482_remove(struct i2c_client *client);
102 87
103 88
@@ -117,8 +102,6 @@ static struct i2c_driver ds2482_driver = {
117 .probe = ds2482_probe, 102 .probe = ds2482_probe,
118 .remove = ds2482_remove, 103 .remove = ds2482_remove,
119 .id_table = ds2482_id, 104 .id_table = ds2482_id,
120 .detect = ds2482_detect,
121 .address_data = &addr_data,
122}; 105};
123 106
124/* 107/*
@@ -231,7 +214,7 @@ static int ds2482_wait_1wire_idle(struct ds2482_data *pdev)
231 (++retries < DS2482_WAIT_IDLE_TIMEOUT)); 214 (++retries < DS2482_WAIT_IDLE_TIMEOUT));
232 } 215 }
233 216
234 if (retries > DS2482_WAIT_IDLE_TIMEOUT) 217 if (retries >= DS2482_WAIT_IDLE_TIMEOUT)
235 printk(KERN_ERR "%s: timeout on channel %d\n", 218 printk(KERN_ERR "%s: timeout on channel %d\n",
236 __func__, pdev->channel); 219 __func__, pdev->channel);
237 220
@@ -425,19 +408,6 @@ static u8 ds2482_w1_reset_bus(void *data)
425} 408}
426 409
427 410
428static int ds2482_detect(struct i2c_client *client, int kind,
429 struct i2c_board_info *info)
430{
431 if (!i2c_check_functionality(client->adapter,
432 I2C_FUNC_SMBUS_WRITE_BYTE_DATA |
433 I2C_FUNC_SMBUS_BYTE))
434 return -ENODEV;
435
436 strlcpy(info->type, "ds2482", I2C_NAME_SIZE);
437
438 return 0;
439}
440
441static int ds2482_probe(struct i2c_client *client, 411static int ds2482_probe(struct i2c_client *client,
442 const struct i2c_device_id *id) 412 const struct i2c_device_id *id)
443{ 413{
@@ -446,6 +416,11 @@ static int ds2482_probe(struct i2c_client *client,
446 int temp1; 416 int temp1;
447 int idx; 417 int idx;
448 418
419 if (!i2c_check_functionality(client->adapter,
420 I2C_FUNC_SMBUS_WRITE_BYTE_DATA |
421 I2C_FUNC_SMBUS_BYTE))
422 return -ENODEV;
423
449 if (!(data = kzalloc(sizeof(struct ds2482_data), GFP_KERNEL))) { 424 if (!(data = kzalloc(sizeof(struct ds2482_data), GFP_KERNEL))) {
450 err = -ENOMEM; 425 err = -ENOMEM;
451 goto exit; 426 goto exit;
diff --git a/drivers/w1/masters/ds2490.c b/drivers/w1/masters/ds2490.c
index 59ad6e95af8f..02bf7bf7160b 100644
--- a/drivers/w1/masters/ds2490.c
+++ b/drivers/w1/masters/ds2490.c
@@ -23,6 +23,7 @@
23#include <linux/kernel.h> 23#include <linux/kernel.h>
24#include <linux/mod_devicetable.h> 24#include <linux/mod_devicetable.h>
25#include <linux/usb.h> 25#include <linux/usb.h>
26#include <linux/slab.h>
26 27
27#include "../w1_int.h" 28#include "../w1_int.h"
28#include "../w1.h" 29#include "../w1.h"
diff --git a/drivers/w1/masters/mxc_w1.c b/drivers/w1/masters/mxc_w1.c
index 65244c02551b..a3b6a74c67a7 100644
--- a/drivers/w1/masters/mxc_w1.c
+++ b/drivers/w1/masters/mxc_w1.c
@@ -21,6 +21,7 @@
21#include <linux/interrupt.h> 21#include <linux/interrupt.h>
22#include <linux/platform_device.h> 22#include <linux/platform_device.h>
23#include <linux/clk.h> 23#include <linux/clk.h>
24#include <linux/slab.h>
24#include <linux/delay.h> 25#include <linux/delay.h>
25#include <linux/io.h> 26#include <linux/io.h>
26 27
@@ -102,7 +103,7 @@ static u8 mxc_w1_ds2_touch_bit(void *data, u8 bit)
102 return ((__raw_readb(ctrl_addr)) >> 3) & 0x1; 103 return ((__raw_readb(ctrl_addr)) >> 3) & 0x1;
103} 104}
104 105
105static int __init mxc_w1_probe(struct platform_device *pdev) 106static int __devinit mxc_w1_probe(struct platform_device *pdev)
106{ 107{
107 struct mxc_w1_device *mdev; 108 struct mxc_w1_device *mdev;
108 struct resource *res; 109 struct resource *res;
@@ -166,7 +167,7 @@ failed_clk:
166/* 167/*
167 * disassociate the w1 device from the driver 168 * disassociate the w1 device from the driver
168 */ 169 */
169static int mxc_w1_remove(struct platform_device *pdev) 170static int __devexit mxc_w1_remove(struct platform_device *pdev)
170{ 171{
171 struct mxc_w1_device *mdev = platform_get_drvdata(pdev); 172 struct mxc_w1_device *mdev = platform_get_drvdata(pdev);
172 struct resource *res; 173 struct resource *res;
diff --git a/drivers/w1/masters/omap_hdq.c b/drivers/w1/masters/omap_hdq.c
index a7e3b706b9d3..3a7e9ff8a746 100644
--- a/drivers/w1/masters/omap_hdq.c
+++ b/drivers/w1/masters/omap_hdq.c
@@ -12,9 +12,11 @@
12#include <linux/module.h> 12#include <linux/module.h>
13#include <linux/platform_device.h> 13#include <linux/platform_device.h>
14#include <linux/interrupt.h> 14#include <linux/interrupt.h>
15#include <linux/slab.h>
15#include <linux/err.h> 16#include <linux/err.h>
16#include <linux/clk.h> 17#include <linux/clk.h>
17#include <linux/io.h> 18#include <linux/io.h>
19#include <linux/sched.h>
18 20
19#include <asm/irq.h> 21#include <asm/irq.h>
20#include <mach/hardware.h> 22#include <mach/hardware.h>
@@ -72,7 +74,7 @@ struct hdq_data {
72 int init_trans; 74 int init_trans;
73}; 75};
74 76
75static int __init omap_hdq_probe(struct platform_device *pdev); 77static int __devinit omap_hdq_probe(struct platform_device *pdev);
76static int omap_hdq_remove(struct platform_device *pdev); 78static int omap_hdq_remove(struct platform_device *pdev);
77 79
78static struct platform_driver omap_hdq_driver = { 80static struct platform_driver omap_hdq_driver = {
@@ -558,7 +560,7 @@ static void omap_w1_write_byte(void *_hdq, u8 byte)
558 return; 560 return;
559} 561}
560 562
561static int __init omap_hdq_probe(struct platform_device *pdev) 563static int __devinit omap_hdq_probe(struct platform_device *pdev)
562{ 564{
563 struct hdq_data *hdq_data; 565 struct hdq_data *hdq_data;
564 struct resource *res; 566 struct resource *res;
@@ -687,6 +689,7 @@ static int omap_hdq_remove(struct platform_device *pdev)
687 689
688 if (hdq_data->hdq_usecount) { 690 if (hdq_data->hdq_usecount) {
689 dev_dbg(&pdev->dev, "removed when use count is not zero\n"); 691 dev_dbg(&pdev->dev, "removed when use count is not zero\n");
692 mutex_unlock(&hdq_data->hdq_mutex);
690 return -EBUSY; 693 return -EBUSY;
691 } 694 }
692 695
diff --git a/drivers/w1/masters/w1-gpio.c b/drivers/w1/masters/w1-gpio.c
index 6f8866d6a905..fcbe742188a5 100644
--- a/drivers/w1/masters/w1-gpio.c
+++ b/drivers/w1/masters/w1-gpio.c
@@ -11,6 +11,7 @@
11#include <linux/init.h> 11#include <linux/init.h>
12#include <linux/module.h> 12#include <linux/module.h>
13#include <linux/platform_device.h> 13#include <linux/platform_device.h>
14#include <linux/slab.h>
14#include <linux/w1-gpio.h> 15#include <linux/w1-gpio.h>
15 16
16#include "../w1.h" 17#include "../w1.h"
diff --git a/drivers/w1/slaves/w1_ds2431.c b/drivers/w1/slaves/w1_ds2431.c
index 2c6c0cf6a20f..84e2410aec1d 100644
--- a/drivers/w1/slaves/w1_ds2431.c
+++ b/drivers/w1/slaves/w1_ds2431.c
@@ -96,7 +96,7 @@ static int w1_f2d_readblock(struct w1_slave *sl, int off, int count, char *buf)
96 return -1; 96 return -1;
97} 97}
98 98
99static ssize_t w1_f2d_read_bin(struct kobject *kobj, 99static ssize_t w1_f2d_read_bin(struct file *filp, struct kobject *kobj,
100 struct bin_attribute *bin_attr, 100 struct bin_attribute *bin_attr,
101 char *buf, loff_t off, size_t count) 101 char *buf, loff_t off, size_t count)
102{ 102{
@@ -202,7 +202,7 @@ retry:
202 return 0; 202 return 0;
203} 203}
204 204
205static ssize_t w1_f2d_write_bin(struct kobject *kobj, 205static ssize_t w1_f2d_write_bin(struct file *filp, struct kobject *kobj,
206 struct bin_attribute *bin_attr, 206 struct bin_attribute *bin_attr,
207 char *buf, loff_t off, size_t count) 207 char *buf, loff_t off, size_t count)
208{ 208{
diff --git a/drivers/w1/slaves/w1_ds2433.c b/drivers/w1/slaves/w1_ds2433.c
index 139447148822..0f7b8f9c509a 100644
--- a/drivers/w1/slaves/w1_ds2433.c
+++ b/drivers/w1/slaves/w1_ds2433.c
@@ -13,6 +13,7 @@
13#include <linux/device.h> 13#include <linux/device.h>
14#include <linux/types.h> 14#include <linux/types.h>
15#include <linux/delay.h> 15#include <linux/delay.h>
16#include <linux/slab.h>
16#ifdef CONFIG_W1_SLAVE_DS2433_CRC 17#ifdef CONFIG_W1_SLAVE_DS2433_CRC
17#include <linux/crc16.h> 18#include <linux/crc16.h>
18 19
@@ -91,7 +92,7 @@ static int w1_f23_refresh_block(struct w1_slave *sl, struct w1_f23_data *data,
91} 92}
92#endif /* CONFIG_W1_SLAVE_DS2433_CRC */ 93#endif /* CONFIG_W1_SLAVE_DS2433_CRC */
93 94
94static ssize_t w1_f23_read_bin(struct kobject *kobj, 95static ssize_t w1_f23_read_bin(struct file *filp, struct kobject *kobj,
95 struct bin_attribute *bin_attr, 96 struct bin_attribute *bin_attr,
96 char *buf, loff_t off, size_t count) 97 char *buf, loff_t off, size_t count)
97{ 98{
@@ -205,7 +206,7 @@ static int w1_f23_write(struct w1_slave *sl, int addr, int len, const u8 *data)
205 return 0; 206 return 0;
206} 207}
207 208
208static ssize_t w1_f23_write_bin(struct kobject *kobj, 209static ssize_t w1_f23_write_bin(struct file *filp, struct kobject *kobj,
209 struct bin_attribute *bin_attr, 210 struct bin_attribute *bin_attr,
210 char *buf, loff_t off, size_t count) 211 char *buf, loff_t off, size_t count)
211{ 212{
diff --git a/drivers/w1/slaves/w1_ds2760.c b/drivers/w1/slaves/w1_ds2760.c
index 1f09d4e4144c..483d45180911 100644
--- a/drivers/w1/slaves/w1_ds2760.c
+++ b/drivers/w1/slaves/w1_ds2760.c
@@ -16,6 +16,7 @@
16#include <linux/platform_device.h> 16#include <linux/platform_device.h>
17#include <linux/mutex.h> 17#include <linux/mutex.h>
18#include <linux/idr.h> 18#include <linux/idr.h>
19#include <linux/gfp.h>
19 20
20#include "../w1.h" 21#include "../w1.h"
21#include "../w1_int.h" 22#include "../w1_int.h"
@@ -68,7 +69,35 @@ int w1_ds2760_write(struct device *dev, char *buf, int addr, size_t count)
68 return w1_ds2760_io(dev, buf, addr, count, 1); 69 return w1_ds2760_io(dev, buf, addr, count, 1);
69} 70}
70 71
71static ssize_t w1_ds2760_read_bin(struct kobject *kobj, 72static int w1_ds2760_eeprom_cmd(struct device *dev, int addr, int cmd)
73{
74 struct w1_slave *sl = container_of(dev, struct w1_slave, dev);
75
76 if (!dev)
77 return -EINVAL;
78
79 mutex_lock(&sl->master->mutex);
80
81 if (w1_reset_select_slave(sl) == 0) {
82 w1_write_8(sl->master, cmd);
83 w1_write_8(sl->master, addr);
84 }
85
86 mutex_unlock(&sl->master->mutex);
87 return 0;
88}
89
90int w1_ds2760_store_eeprom(struct device *dev, int addr)
91{
92 return w1_ds2760_eeprom_cmd(dev, addr, W1_DS2760_COPY_DATA);
93}
94
95int w1_ds2760_recall_eeprom(struct device *dev, int addr)
96{
97 return w1_ds2760_eeprom_cmd(dev, addr, W1_DS2760_RECALL_DATA);
98}
99
100static ssize_t w1_ds2760_read_bin(struct file *filp, struct kobject *kobj,
72 struct bin_attribute *bin_attr, 101 struct bin_attribute *bin_attr,
73 char *buf, loff_t off, size_t count) 102 char *buf, loff_t off, size_t count)
74{ 103{
@@ -200,6 +229,8 @@ static void __exit w1_ds2760_exit(void)
200 229
201EXPORT_SYMBOL(w1_ds2760_read); 230EXPORT_SYMBOL(w1_ds2760_read);
202EXPORT_SYMBOL(w1_ds2760_write); 231EXPORT_SYMBOL(w1_ds2760_write);
232EXPORT_SYMBOL(w1_ds2760_store_eeprom);
233EXPORT_SYMBOL(w1_ds2760_recall_eeprom);
203 234
204module_init(w1_ds2760_init); 235module_init(w1_ds2760_init);
205module_exit(w1_ds2760_exit); 236module_exit(w1_ds2760_exit);
diff --git a/drivers/w1/slaves/w1_ds2760.h b/drivers/w1/slaves/w1_ds2760.h
index f1302429cb02..58e774141568 100644
--- a/drivers/w1/slaves/w1_ds2760.h
+++ b/drivers/w1/slaves/w1_ds2760.h
@@ -25,6 +25,10 @@
25 25
26#define DS2760_PROTECTION_REG 0x00 26#define DS2760_PROTECTION_REG 0x00
27#define DS2760_STATUS_REG 0x01 27#define DS2760_STATUS_REG 0x01
28 #define DS2760_STATUS_IE (1 << 2)
29 #define DS2760_STATUS_SWEN (1 << 3)
30 #define DS2760_STATUS_RNAOP (1 << 4)
31 #define DS2760_STATUS_PMOD (1 << 5)
28#define DS2760_EEPROM_REG 0x07 32#define DS2760_EEPROM_REG 0x07
29#define DS2760_SPECIAL_FEATURE_REG 0x08 33#define DS2760_SPECIAL_FEATURE_REG 0x08
30#define DS2760_VOLTAGE_MSB 0x0c 34#define DS2760_VOLTAGE_MSB 0x0c
@@ -38,6 +42,7 @@
38#define DS2760_EEPROM_BLOCK0 0x20 42#define DS2760_EEPROM_BLOCK0 0x20
39#define DS2760_ACTIVE_FULL 0x20 43#define DS2760_ACTIVE_FULL 0x20
40#define DS2760_EEPROM_BLOCK1 0x30 44#define DS2760_EEPROM_BLOCK1 0x30
45#define DS2760_STATUS_WRITE_REG 0x31
41#define DS2760_RATED_CAPACITY 0x32 46#define DS2760_RATED_CAPACITY 0x32
42#define DS2760_CURRENT_OFFSET_BIAS 0x33 47#define DS2760_CURRENT_OFFSET_BIAS 0x33
43#define DS2760_ACTIVE_EMPTY 0x3b 48#define DS2760_ACTIVE_EMPTY 0x3b
@@ -46,5 +51,7 @@ extern int w1_ds2760_read(struct device *dev, char *buf, int addr,
46 size_t count); 51 size_t count);
47extern int w1_ds2760_write(struct device *dev, char *buf, int addr, 52extern int w1_ds2760_write(struct device *dev, char *buf, int addr,
48 size_t count); 53 size_t count);
54extern int w1_ds2760_store_eeprom(struct device *dev, int addr);
55extern int w1_ds2760_recall_eeprom(struct device *dev, int addr);
49 56
50#endif /* !__w1_ds2760_h__ */ 57#endif /* !__w1_ds2760_h__ */
diff --git a/drivers/w1/slaves/w1_therm.c b/drivers/w1/slaves/w1_therm.c
index 1ed3d554e372..17726a05a0a6 100644
--- a/drivers/w1/slaves/w1_therm.c
+++ b/drivers/w1/slaves/w1_therm.c
@@ -115,9 +115,8 @@ static struct w1_therm_family_converter w1_therm_families[] = {
115 115
116static inline int w1_DS18B20_convert_temp(u8 rom[9]) 116static inline int w1_DS18B20_convert_temp(u8 rom[9])
117{ 117{
118 int t = ((s16)rom[1] << 8) | rom[0]; 118 s16 t = le16_to_cpup((__le16 *)rom);
119 t = t*1000/16; 119 return t*1000/16;
120 return t;
121} 120}
122 121
123static inline int w1_DS18S20_convert_temp(u8 rom[9]) 122static inline int w1_DS18S20_convert_temp(u8 rom[9])
diff --git a/drivers/w1/w1.c b/drivers/w1/w1.c
index acc7e3b7fe17..b7b5014ff714 100644
--- a/drivers/w1/w1.c
+++ b/drivers/w1/w1.c
@@ -120,7 +120,7 @@ static struct device_attribute w1_slave_attr_id =
120 120
121/* Default family */ 121/* Default family */
122 122
123static ssize_t w1_default_write(struct kobject *kobj, 123static ssize_t w1_default_write(struct file *filp, struct kobject *kobj,
124 struct bin_attribute *bin_attr, 124 struct bin_attribute *bin_attr,
125 char *buf, loff_t off, size_t count) 125 char *buf, loff_t off, size_t count)
126{ 126{
@@ -139,7 +139,7 @@ out_up:
139 return count; 139 return count;
140} 140}
141 141
142static ssize_t w1_default_read(struct kobject *kobj, 142static ssize_t w1_default_read(struct file *filp, struct kobject *kobj,
143 struct bin_attribute *bin_attr, 143 struct bin_attribute *bin_attr,
144 char *buf, loff_t off, size_t count) 144 char *buf, loff_t off, size_t count)
145{ 145{
@@ -517,10 +517,10 @@ static W1_MASTER_ATTR_RO(max_slave_count, S_IRUGO);
517static W1_MASTER_ATTR_RO(attempts, S_IRUGO); 517static W1_MASTER_ATTR_RO(attempts, S_IRUGO);
518static W1_MASTER_ATTR_RO(timeout, S_IRUGO); 518static W1_MASTER_ATTR_RO(timeout, S_IRUGO);
519static W1_MASTER_ATTR_RO(pointer, S_IRUGO); 519static W1_MASTER_ATTR_RO(pointer, S_IRUGO);
520static W1_MASTER_ATTR_RW(search, S_IRUGO | S_IWUGO); 520static W1_MASTER_ATTR_RW(search, S_IRUGO | S_IWUSR | S_IWGRP);
521static W1_MASTER_ATTR_RW(pullup, S_IRUGO | S_IWUGO); 521static W1_MASTER_ATTR_RW(pullup, S_IRUGO | S_IWUSR | S_IWGRP);
522static W1_MASTER_ATTR_RW(add, S_IRUGO | S_IWUGO); 522static W1_MASTER_ATTR_RW(add, S_IRUGO | S_IWUSR | S_IWGRP);
523static W1_MASTER_ATTR_RW(remove, S_IRUGO | S_IWUGO); 523static W1_MASTER_ATTR_RW(remove, S_IRUGO | S_IWUSR | S_IWGRP);
524 524
525static struct attribute *w1_master_default_attrs[] = { 525static struct attribute *w1_master_default_attrs[] = {
526 &w1_master_attribute_name.attr, 526 &w1_master_attribute_name.attr,
@@ -986,7 +986,7 @@ int w1_process(void *data)
986 return 0; 986 return 0;
987} 987}
988 988
989static int w1_init(void) 989static int __init w1_init(void)
990{ 990{
991 int retval; 991 int retval;
992 992
@@ -1034,7 +1034,7 @@ err_out_exit_init:
1034 return retval; 1034 return retval;
1035} 1035}
1036 1036
1037static void w1_fini(void) 1037static void __exit w1_fini(void)
1038{ 1038{
1039 struct w1_master *dev; 1039 struct w1_master *dev;
1040 1040
diff --git a/drivers/w1/w1_int.c b/drivers/w1/w1_int.c
index 4a46ed58ece9..b50be3f1073d 100644
--- a/drivers/w1/w1_int.c
+++ b/drivers/w1/w1_int.c
@@ -23,6 +23,7 @@
23#include <linux/list.h> 23#include <linux/list.h>
24#include <linux/delay.h> 24#include <linux/delay.h>
25#include <linux/kthread.h> 25#include <linux/kthread.h>
26#include <linux/slab.h>
26 27
27#include "w1.h" 28#include "w1.h"
28#include "w1_log.h" 29#include "w1_log.h"
diff --git a/drivers/w1/w1_netlink.c b/drivers/w1/w1_netlink.c
index fdf72851c574..7e667bc77ef2 100644
--- a/drivers/w1/w1_netlink.c
+++ b/drivers/w1/w1_netlink.c
@@ -19,6 +19,7 @@
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 */ 20 */
21 21
22#include <linux/slab.h>
22#include <linux/skbuff.h> 23#include <linux/skbuff.h>
23#include <linux/netlink.h> 24#include <linux/netlink.h>
24#include <linux/connector.h> 25#include <linux/connector.h>
@@ -306,9 +307,8 @@ static int w1_netlink_send_error(struct cn_msg *rcmsg, struct w1_netlink_msg *rm
306 return error; 307 return error;
307} 308}
308 309
309static void w1_cn_callback(void *data) 310static void w1_cn_callback(struct cn_msg *msg, struct netlink_skb_parms *nsp)
310{ 311{
311 struct cn_msg *msg = data;
312 struct w1_netlink_msg *m = (struct w1_netlink_msg *)(msg + 1); 312 struct w1_netlink_msg *m = (struct w1_netlink_msg *)(msg + 1);
313 struct w1_netlink_cmd *cmd; 313 struct w1_netlink_cmd *cmd;
314 struct w1_slave *sl; 314 struct w1_slave *sl;