Skip to content

Commit

Permalink
Merge tag 'char-misc-3.12-rc6' of git://git.kernel.org/pub/scm/linux/…
Browse files Browse the repository at this point in the history
…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
  • Loading branch information
Linus Torvalds committed Oct 17, 2013
2 parents 630db0e + e13cef8 commit 66eb411
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
6 changes: 4 additions & 2 deletions drivers/iio/frequency/adf4350.c
Original file line number Diff line number Diff line change
Expand Up @@ -525,8 +525,10 @@ static int adf4350_probe(struct spi_device *spi)
}

indio_dev = devm_iio_device_alloc(&spi->dev, sizeof(*st));
if (indio_dev == NULL)
return -ENOMEM;
if (indio_dev == NULL) {
ret = -ENOMEM;
goto error_disable_clk;
}

st = iio_priv(indio_dev);

Expand Down
3 changes: 3 additions & 0 deletions drivers/iio/industrialio-buffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -477,6 +477,9 @@ void iio_disable_all_buffers(struct iio_dev *indio_dev)
indio_dev->currentmode = INDIO_DIRECT_MODE;
if (indio_dev->setup_ops->postdisable)
indio_dev->setup_ops->postdisable(indio_dev);

if (indio_dev->available_scan_masks == NULL)
kfree(indio_dev->active_scan_mask);
}

int iio_update_buffers(struct iio_dev *indio_dev,
Expand Down
6 changes: 6 additions & 0 deletions drivers/w1/w1.c
Original file line number Diff line number Diff line change
Expand Up @@ -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... */
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 66eb411

Please sign in to comment.