aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/w1/w1_int.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/w1/w1_int.c')
-rw-r--r--drivers/w1/w1_int.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/w1/w1_int.c b/drivers/w1/w1_int.c
index ce24e3b3fc2a..280f140ae698 100644
--- a/drivers/w1/w1_int.c
+++ b/drivers/w1/w1_int.c
@@ -121,6 +121,14 @@ int w1_add_master_device(struct w1_bus_master *master)
121 int retval = 0; 121 int retval = 0;
122 struct w1_netlink_msg msg; 122 struct w1_netlink_msg msg;
123 123
124 /* validate minimum functionality */
125 if (!(master->touch_bit && master->reset_bus) &&
126 !(master->write_bit && master->read_bit))
127 {
128 printk(KERN_ERR "w1_add_master_device: invalid function set\n");
129 return(-EINVAL);
130 }
131
124 dev = w1_alloc_dev(w1_ids++, w1_max_slave_count, w1_max_slave_ttl, &w1_driver, &w1_device); 132 dev = w1_alloc_dev(w1_ids++, w1_max_slave_count, w1_max_slave_ttl, &w1_driver, &w1_device);
125 if (!dev) 133 if (!dev)
126 return -ENOMEM; 134 return -ENOMEM;