[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>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
4e470aa964
commit
be57ce267f
@@ -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;
|
||||
|
Reference in New Issue
Block a user