Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 354343
b: refs/heads/master
c: de06d7c
h: refs/heads/master
i:
  354341: f6b7d24
  354339: 11be97d
  354335: 102c541
v: v3
  • Loading branch information
Ian Abbott authored and Greg Kroah-Hartman committed Feb 4, 2013
1 parent dfa6324 commit 4812a07
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 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: da71751177f35f0ca5494968cc237511c423a744
refs/heads/master: de06d7c6b8e3b886eec0302ecbadf76944a42ca4
15 changes: 11 additions & 4 deletions trunk/drivers/staging/comedi/drivers.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,21 @@ struct comedi_driver *comedi_drivers;

int comedi_set_hw_dev(struct comedi_device *dev, struct device *hw_dev)
{
struct device *old_hw_dev = dev->hw_dev;

if (hw_dev == dev->hw_dev)
return 0;
if (dev->hw_dev != NULL)
return -EEXIST;
dev->hw_dev = get_device(hw_dev);
put_device(old_hw_dev);
return 0;
}
EXPORT_SYMBOL_GPL(comedi_set_hw_dev);

static void comedi_clear_hw_dev(struct comedi_device *dev)
{
put_device(dev->hw_dev);
dev->hw_dev = NULL;
}

int comedi_alloc_subdevices(struct comedi_device *dev, int num_subdevices)
{
struct comedi_subdevice *s;
Expand Down Expand Up @@ -108,7 +115,7 @@ static void cleanup_device(struct comedi_device *dev)
dev->write_subdev = NULL;
dev->open = NULL;
dev->close = NULL;
comedi_set_hw_dev(dev, NULL);
comedi_clear_hw_dev(dev);
}

static void __comedi_device_detach(struct comedi_device *dev)
Expand Down

0 comments on commit 4812a07

Please sign in to comment.