diff options
author | Evgeniy Polyakov <johnpol@2ka.mipt.ru> | 2005-06-03 23:21:46 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2005-06-22 06:43:10 +0200 |
commit | be57ce267fd558c52d2389530c15618681b7cfa7 (patch) | |
tree | 74b9d71873a9bd3152c955114b846c251f7216a9 /drivers/w1/w1_int.c | |
parent | [PATCH] w1_therm: removed duplicated family id. (diff) | |
download | linux-be57ce267fd558c52d2389530c15618681b7cfa7.tar.xz linux-be57ce267fd558c52d2389530c15618681b7cfa7.zip |
[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.c | 8 |
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; |