X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=drivers%2Fw1%2Fw1_family.c;h=0e32c114f906ecd7688e8f7118becda7f2997233;hb=43bc926fffd92024b46cafaf7350d669ba9ca884;hp=d1d56eca1061c7c112fba35a7a39c0c294b72fcb;hpb=cee37fe97739d85991964371c1f3a745c00dd236;p=linux-2.6.git diff --git a/drivers/w1/w1_family.c b/drivers/w1/w1_family.c index d1d56eca1..0e32c114f 100644 --- a/drivers/w1/w1_family.c +++ b/drivers/w1/w1_family.c @@ -1,8 +1,8 @@ /* - * w1_family.c + * w1_family.c * * Copyright (c) 2004 Evgeniy Polyakov - * + * * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -21,30 +21,21 @@ #include #include +#include /* schedule_timeout() */ #include #include "w1_family.h" +#include "w1.h" DEFINE_SPINLOCK(w1_flock); static LIST_HEAD(w1_families); -static int w1_check_family(struct w1_family *f) -{ - if (!f->fops->rname || !f->fops->rbin || !f->fops->rval || !f->fops->rvalname) - return -EINVAL; - - return 0; -} - int w1_register_family(struct w1_family *newf) { struct list_head *ent, *n; struct w1_family *f; int ret = 0; - if (w1_check_family(newf)) - return -EINVAL; - spin_lock(&w1_flock); list_for_each_safe(ent, n, &w1_families) { f = list_entry(ent, struct w1_family, family_entry); @@ -60,9 +51,10 @@ int w1_register_family(struct w1_family *newf) newf->need_exit = 0; list_add_tail(&newf->family_entry, &w1_families); } - spin_unlock(&w1_flock); + w1_reconnect_slaves(newf); + return ret; }