summaryrefslogtreecommitdiff
path: root/drivers/w1
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-10-17 17:36:57 (GMT)
committerLinus Torvalds <torvalds@linux-foundation.org>2013-10-17 17:36:57 (GMT)
commit66eb411ea2d8d12eacc0eadcd5004a1736994814 (patch)
tree3b0f4ba31f81010eb51ebca8c5c8bff5506a487b /drivers/w1
parent630db0e3d2134b0f7949f912ae2adeec6f765719 (diff)
parente13cef8ded69e469b56e150e30619693b91b1864 (diff)
downloadlinux-fsl-qoriq-66eb411ea2d8d12eacc0eadcd5004a1736994814.tar.xz
Merge tag 'char-misc-3.12-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc
Pull char/misc driver fixes from Greg KH: "Here are some small iio and w1 driver fixes for 3.12-rc6. There is also a hyper-v fix in here, which turned out to be incorrect, so it was reverted. That will probably have to wait unto 3.13-rc1 to get accepted as it's still being discussed" * tag 'char-misc-3.12-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: Revert "Drivers: hv: vmbus: Fix a bug in channel rescind code" Drivers: hv: vmbus: Fix a bug in channel rescind code iio:buffer: Free active scan mask in iio_disable_all_buffers() iio: frequency: adf4350: add missing clk_disable_unprepare() on error in adf4350_probe() w1 - call request_module with w1 master mutex unlocked w1 - fix fops in w1_bus_notify
Diffstat (limited to 'drivers/w1')
-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 c7c64f1..fa932c2 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,
sl = dev_to_w1_slave(dev);
fops = sl->family->fops;
+ if (!fops)
+ return 0;
+
switch (action) {
case BUS_NOTIFY_ADD_DEVICE:
/* 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)
atomic_set(&sl->refcnt, 0);
init_completion(&sl->released);
+ /* slave modules need to be loaded in a context with unlocked mutex */
+ mutex_unlock(&dev->mutex);
request_module("w1-family-0x%0x", rn->family);
+ mutex_lock(&dev->mutex);
spin_lock(&w1_flock);
f = w1_family_registered(rn->family);