1. 01 May, 2007 6 commits
    • David Brownell's avatar
      i2c: Class attribute cleanup · 16ffadfc
      David Brownell authored
      This patch is a minor cleanup/code shrink, using class infrastructure
      in i2c-core to manage the i2c_adapter attribute.
      Signed-off-by: default avatarDavid Brownell <dbrownell@users.sourceforge.net>
      Signed-off-by: default avatarJean Delvare <khali@linux-fr.org>
      16ffadfc
    • David Brownell's avatar
      i2c: Shrink struct i2c_client · 2096b956
      David Brownell authored
      This shrinks the size of "struct i2c_client" by 40 bytes:
      
       - Substantially shrinks the string used to identify the chip type
       - The "flags" don't need to be so big
       - Removes some internal padding
      
      It also adds kerneldoc for that struct, explaining how "name" is really a
      chip type identifier; it's otherwise potentially confusing.
      
      Because the I2C_NAME_SIZE symbol was abused for both i2c_client.name
      and for i2c_adapter.name, this needed to affect i2c_adapter too.  The
      adapters which used that symbol now use the more-obviously-correct
      idiom of taking the size of that field.
      
      JD: Shorten i2c_adapter.name from 50 to 48 bytes while we're here, to
      avoid wasting space in padding.
      Signed-off-by: default avatarDavid Brownell <dbrownell@users.sourceforge.net>
      Signed-off-by: default avatarJean Delvare <khali@linux-fr.org>
      2096b956
    • David Brownell's avatar
      i2c: i2c_register_driver() cleanup · 4ad4eac6
      David Brownell authored
      Minor cleanup in i2c_register_driver():  use list_for_each_entry().
      Signed-off-by: default avatarDavid Brownell <dbrownell@users.sourceforge.net>
      Signed-off-by: default avatarJean Delvare <khali@linux-fr.org>
      4ad4eac6
    • Jean Delvare's avatar
      i2c: i2c_adapter devices need no driver · b31366f4
      Jean Delvare authored
      Kill i2c_adapter_driver as it doesn't make sense and it prevents
      further i2c-core cleanups. i2c_adapter devices are virtual devices
      (ex-class devices) and as such they don't need a driver.
      Signed-off-by: default avatarJean Delvare <khali@linux-fr.org>
      b31366f4
    • Jean Delvare's avatar
      i2c: Kill i2c_adapter.class_dev · fccb56e4
      Jean Delvare authored
      Kill i2c_adapter.class_dev. Instead, set the class of i2c_adapter.dev
      to i2c_adapter_class, so that a symlink will be created for every
      i2c_adapter in /sys/class/i2c-adapter.
      
      The same change must be mirrored to i2c-isa as it duplicates some
      of the i2c-core functionalities.
      
      User-space tools and libraries might need some adjustments. In
      particular, libsensors from lm_sensors 2.10.3 or later is required for
      proper discovery of i2c adapter names after this change.
      Signed-off-by: default avatarJean Delvare <khali@linux-fr.org>
      fccb56e4
    • Linus Torvalds's avatar
      libata: honour host controllers that want just one host · dc87c398
      Linus Torvalds authored
      The Marvell IDE interface on my machine would hit a BUG_ON() in
      lib/iomem.c because it was calling ata_pci_init_one() specifying just a
      single port on the host, but that would actually end up trying to
      initialize two ports, the second one with bogus information.
      
      This fixes "ata_pci_init_one()" so that it actually passes down the
      n_ports variable that it got from the low-level driver to the host
      allocation routine ("ata_host_alloc_pinfo()"), which results in the ATA
      layer actually having the correct port number information.
      
      And in order to make it all work, I also needed to fix a few places that
      had incorrectly hard-coded the fact that a host always had exactly two
      ports (both ata_pci_init_bmdma() and ata_request_legacy_irqs() would
      just always iterate over both ports).
      Acked-by: default avatarJeff Garzik <jeff@garzik.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      dc87c398
  2. 30 Apr, 2007 34 commits