1. 23 Jun, 2012 8 commits
  2. 19 Jun, 2012 2 commits
  3. 12 Jun, 2012 2 commits
  4. 05 Jun, 2012 2 commits
  5. 19 May, 2012 1 commit
    • H Hartley Sweeten's avatar
      staging: comedi: cleanup all the comedi_driver 'detach' functions · 484ecc95
      H Hartley Sweeten authored
      1. Change the return type from int to void
      All the detach functions, except for the comedi usb drivers, simply
      return success (0). Plus, the return code is never checked in the
      comedi core.
      The comedi usb drivers do return error codes but the conditions can
      never happen.
      The first check is:
      	if (!dev)
      		return -EFAULT;
      This checks that the passed comedi_device pointer is valid. The detach
      function itself is called using this pointer so it MUST always be valid
      or there is a bug in the core:
      	if (dev->driver)
      And the second check:
      	usb = dev->private;
      	if (!usb)
      		return -EFAULT;
      The dev->private pointer is setup in the attach function to point to the
      probed usb device. This value could be NULL if the attach fails. But,
      since the comedi core is going to unload the driver anyway and does not
      check for errors there is no gain by returning one.
      After removing these checks from the comedi usb drivers the detach
      functions required a bit of cleanup.
      2. Remove all the printk noise in the detach functions
      All of the printk output is really just noise. The user did a rmmod to
      unload the driver, we really don't need to tell them about it.
      Also, some of the messages are output using:
      	dev_dbg(dev->hw_dev, ...
      	dev_info(dev->hw_dev, ...
      Unfortunately the hw_dev value is only used by drivers that are doing
      DMA. For most drivers this variable is going to be NULL so the output
      is not going to work as expected.
      3. Refactor a couple static 'free_resource' functions into the detach
      The 'free_resource' function is only being called by the detach and it
      makes more sense to just absorb the code.
      4. Remove a couple unnecessary braces for single statements.
      5. Remove unnecessary comments.
      Most of the comedi drivers appear to be based on the comedi skel driver
      and have the comments from that driver included. These comments make
      sense in the skel driver for reference but they don't need to be in any
      of the actual drivers.
      6. Remove all the extra whitespace.
      It's not needed to make the functions any more readable.
      7. Remove the now unused 'attached_successfully' variable in the
         cb_pcimdda driver.
      This variable was only used to conditionally output some driver noise
      during the detach. Since all the printk's have been removed this
      variable is no longer necessary.
      Signed-off-by: default avatarH Hartley Sweeten <hsweeten@visionengravers.com>
      Cc: Ian Abbott <abbotti@mev.co.uk>
      Cc: Mori Hess <fmhess@users.sourceforge.net>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
  6. 14 May, 2012 1 commit
    • H Hartley Sweeten's avatar
      staging: comedi: Use module_comedi_pci_driver and standardize drivers · 75e6301b
      H Hartley Sweeten authored
      Convert the refactored comedi pci drivers to use the
      module_comedi_pci_driver() macro which makes the code
      smaller and a bit simpler.
      In the process, rename some of the symbols in the driver
      to standardize the comedi pci drivers.
      Based on the driver {name}:
      1) Rename the comedi_driver to {name}_driver.
      2) Use a static string {name} for the comedi_driver.driver_name.
      3) Rename the pci probe/remove functions to {name)_pci_probe/remove.
      4) Rename the pci id_table to {name}_pci_table.
      5) Add the static string {name} for the pci_driver.name.
      Signed-off-by: default avatarH Hartley Sweeten <hsweeten@visionengravers.com>
      Cc: Ian Abbott <abbotti@mev.co.uk>
      Cc: Mori Hess <fmhess@users.sourceforge.net>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
  7. 09 May, 2012 1 commit
  8. 24 Apr, 2012 1 commit
  9. 10 Apr, 2012 1 commit
    • Ian Abbott's avatar
      staging: comedi: pass 'struct comedi_driver *' to comedi_..._auto_config · 4c093a6d
      Ian Abbott authored
      The comedi_pci_auto_config() and comedi_usb_auto_config() functions
      currently take a board name parameter which is actually a driver name
      parameter.  Replace it with a pointer to the struct comedi_driver.  This
      will allow comedi_pci_auto_config() and comedi_usb_auto_config() to call
      bus-type-specific auto-configuration hooks in the struct comedi_driver
      if they exist (they don't yet).  The idea is that these
      bus-type-specific auto-configuration hooks won't have to search the bus
      for the device being auto-configured like 'attach()' hook has to.
      Signed-off-by: default avatarIan Abbott <abbotti@mev.co.uk>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
  10. 31 Mar, 2011 1 commit
  11. 22 Jun, 2010 2 commits
  12. 17 Jun, 2010 2 commits
  13. 04 Mar, 2010 1 commit
  14. 11 Dec, 2009 1 commit
  15. 15 Sep, 2009 2 commits
  16. 12 Jul, 2009 1 commit
  17. 19 Jun, 2009 6 commits
  18. 03 Apr, 2009 5 commits