Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 280994
b: refs/heads/master
c: 5dd72ec
h: refs/heads/master
v: v3
  • Loading branch information
Jonathan Cameron authored and Greg Kroah-Hartman committed Nov 27, 2011
1 parent b0daf8c commit 4066fd9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 4c3d15358a7ffdd587acc02ec91d28989334d4be
refs/heads/master: 5dd72ecb0166498852705939163f375d693d37f3
12 changes: 11 additions & 1 deletion trunk/drivers/staging/iio/industrialio-trigger.c
Original file line number Diff line number Diff line change
Expand Up @@ -220,8 +220,16 @@ static int iio_trigger_attach_poll_func(struct iio_trigger *trig,
ret = request_threaded_irq(pf->irq, pf->h, pf->thread,
pf->type, pf->name,
pf);
if (trig->ops && trig->ops->set_trigger_state && notinuse)
if (ret < 0) {
module_put(pf->indio_dev->info->driver_module);
return ret;
}

if (trig->ops && trig->ops->set_trigger_state && notinuse) {
ret = trig->ops->set_trigger_state(trig, true);
if (ret < 0)
module_put(pf->indio_dev->info->driver_module);
}

return ret;
}
Expand Down Expand Up @@ -334,6 +342,8 @@ static ssize_t iio_trigger_write_current(struct device *dev,
mutex_unlock(&indio_dev->mlock);

trig = iio_trigger_find_by_name(buf, len);
if (oldtrig == trig)
return len;

if (trig && indio_dev->info->validate_trigger) {
ret = indio_dev->info->validate_trigger(indio_dev, trig);
Expand Down

0 comments on commit 4066fd9

Please sign in to comment.