aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/w1/w1.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/w1/w1.c')
-rw-r--r--drivers/w1/w1.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/w1/w1.c b/drivers/w1/w1.c
index c7c64f18773d..fa932c2f7d97 100644
--- a/drivers/w1/w1.c
+++ b/drivers/w1/w1.c
@@ -613,6 +613,9 @@ static int w1_bus_notify(struct notifier_block *nb, unsigned long action,
613 sl = dev_to_w1_slave(dev); 613 sl = dev_to_w1_slave(dev);
614 fops = sl->family->fops; 614 fops = sl->family->fops;
615 615
616 if (!fops)
617 return 0;
618
616 switch (action) { 619 switch (action) {
617 case BUS_NOTIFY_ADD_DEVICE: 620 case BUS_NOTIFY_ADD_DEVICE:
618 /* if the family driver needs to initialize something... */ 621 /* if the family driver needs to initialize something... */
@@ -713,7 +716,10 @@ static int w1_attach_slave_device(struct w1_master *dev, struct w1_reg_num *rn)
713 atomic_set(&sl->refcnt, 0); 716 atomic_set(&sl->refcnt, 0);
714 init_completion(&sl->released); 717 init_completion(&sl->released);
715 718
719 /* slave modules need to be loaded in a context with unlocked mutex */
720 mutex_unlock(&dev->mutex);
716 request_module("w1-family-0x%0x", rn->family); 721 request_module("w1-family-0x%0x", rn->family);
722 mutex_lock(&dev->mutex);
717 723
718 spin_lock(&w1_flock); 724 spin_lock(&w1_flock);
719 f = w1_family_registered(rn->family); 725 f = w1_family_registered(rn->family);