summaryrefslogtreecommitdiffstats
path: root/drivers/w1/w1_int.c
diff options
context:
space:
mode:
authorEvgeniy Polyakov <johnpol@2ka.mipt.ru>2005-06-04 01:21:46 +0400
committerGreg Kroah-Hartman <gregkh@suse.de>2005-06-21 21:43:10 -0700
commitbe57ce267fd558c52d2389530c15618681b7cfa7 (patch)
tree74b9d71873a9bd3152c955114b846c251f7216a9 /drivers/w1/w1_int.c
parent4e470aa9642d49230bcdfbb393cf5a81da333aba (diff)
downloadlinux-be57ce267fd558c52d2389530c15618681b7cfa7.tar.bz2
[PATCH] w1: Cleans up usage of touch_bit/w1_read_bit/w1_write_bit.
Cleans up usage of touch_bit/w1_read_bit/w1_write_bit. Signed-off-by: Ben Gardner <bgardner@wabtec.com> Signed-off-by: Evgeniy Polyakov <johnpol@2ka.mipt.ru> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
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)
int retval = 0;
struct w1_netlink_msg msg;
+ /* validate minimum functionality */
+ if (!(master->touch_bit && master->reset_bus) &&
+ !(master->write_bit && master->read_bit))
+ {
+ printk(KERN_ERR "w1_add_master_device: invalid function set\n");
+ return(-EINVAL);
+ }
+
dev = w1_alloc_dev(w1_ids++, w1_max_slave_count, w1_max_slave_ttl, &w1_driver, &w1_device);
if (!dev)
return -ENOMEM;