1. 17 10月, 2008 1 次提交
  2. 09 10月, 2008 1 次提交
    • T
      driver-core: use klist for class device list and implement iterator · 5a3ceb86
      Tejun Heo 提交于
      Iterating over entries using callback usually isn't too fun especially
      when the entry being iterated over can't be manipulated freely.  This
      patch converts class->p->class_devices to klist and implements class
      device iterator so that the users can freely build their own control
      structure.  The users are also free to call back into class code
      without worrying about locking.
      
      class_for_each_device() and class_find_device() are converted to use
      the new iterators, so their users don't have to worry about locking
      anymore either.
      
      Note: This depends on klist-dont-iterate-over-deleted-entries patch
      because class_intf->add/remove_dev() depends on proper synchronization
      with device removal.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Cc: Greg Kroah-Hartman <gregkh@suse.de>
      Cc: Jens Axboe <jens.axboe@oracle.com>
      Signed-off-by: NJens Axboe <jens.axboe@oracle.com>
      5a3ceb86
  3. 22 8月, 2008 3 次提交
  4. 27 7月, 2008 1 次提交
  5. 22 7月, 2008 11 次提交
  6. 12 6月, 2008 1 次提交
  7. 30 5月, 2008 1 次提交
  8. 21 5月, 2008 1 次提交
    • G
      Driver core: add device_create_vargs and device_create_drvdata · 8882b394
      Greg Kroah-Hartman 提交于
      We want to have the drvdata field set properly when creating the device
      as sysfs callbacks can assume it is present and it can race the later
      setting of this field.
      
      So, create two new functions, deviec_create_vargs() and
      device_create_drvdata() that take this new field.
      
      device_create_drvdata() will go away in 2.6.27 as the drvdata field will
      just be moved to the device_create() call as it should be.
      
      Cc: Kay Sievers <kay.sievers@vrfy.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      8882b394
  9. 15 5月, 2008 1 次提交
  10. 27 4月, 2008 1 次提交
  11. 20 4月, 2008 4 次提交
  12. 19 4月, 2008 1 次提交
  13. 25 3月, 2008 1 次提交
  14. 05 3月, 2008 3 次提交
  15. 03 2月, 2008 2 次提交
  16. 28 1月, 2008 1 次提交
    • G
      Driver core: Fix up build when CONFIG_BLOCK=N · 4e886c29
      Greg Kroah-Hartman 提交于
      This fixes up the driver core build errors when CONFIG_BLOCK=N
      
      Thanks to Alexander van Heukelum <heukelum@mailshack.com> for the basis
      of this patch, and to Jeremy Fitzhardinge <jeremy@goop.org> for
      reporting the problem.
      
      
      Cc: Alexander van Heukelum <heukelum@mailshack.com>
      Cc: Jeremy Fitzhardinge <jeremy@goop.org>
      Cc: Kay Sievers <kay.sievers@vrfy.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      4e886c29
  17. 25 1月, 2008 6 次提交
    • G
      Driver core: coding style fixes · 4a3ad20c
      Greg Kroah-Hartman 提交于
      Fix up a number of coding style issues in the drivers/base/ directory
      that have annoyed me over the years.  checkpatch.pl is now very happy.
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      4a3ad20c
    • C
      Driver core: Cleanup get_device_parent() in device_add() and device_move() · 63b6971a
      Cornelia Huck 提交于
      Make setup_parent() void as get_device_parent() will always return
      either a valid kobject or NULL.
      Introduce cleanup_glue_dir() to drop reference grabbed on "glue"
      directory by get_device_parent(). Use it for cleanup in device_move()
      and device_add() on errors.
      
      This should fix the refcounting problem reported in
      http://marc.info/?l=linux-kernel&m=120052487909200&w=2Signed-off-by: NCornelia Huck <cornelia.huck@de.ibm.com>
      Cc: Dave Young <hidave.darkstar@gmail.com>
      Cc: Gabor Gombas <gombasg@sztaki.hu>
      Cc: Tejun Heo <htejun@gmail.com>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Cc: Marcel Holtmann <marcel@holtmann.org>
      Cc: David Miller <davem@davemloft.net>
      Cc: Kay Sievers <kay.sievers@vrfy.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      
      63b6971a
    • K
      Kobject: auto-cleanup on final unref · 0f4dafc0
      Kay Sievers 提交于
      We save the current state in the object itself, so we can do proper
      cleanup when the last reference is dropped.
      
      If the initial reference is dropped, the object will be removed from
      sysfs if needed, if an "add" event was sent, "remove" will be send, and
      the allocated resources are released.
      
      This allows us to clean up some driver core usage as well as allowing us
      to do other such changes to the rest of the kernel.
      Signed-off-by: NKay Sievers <kay.sievers@vrfy.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      0f4dafc0
    • G
      Kobject: rename kobject_init_ng() to kobject_init() · f9cb074b
      Greg Kroah-Hartman 提交于
      Now that the old kobject_init() function is gone, rename
      kobject_init_ng() to kobject_init() to clean up the namespace.
      
      Cc: Kay Sievers <kay.sievers@vrfy.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      f9cb074b
    • G
      Kobject: rename kobject_add_ng() to kobject_add() · b2d6db58
      Greg Kroah-Hartman 提交于
      Now that the old kobject_add() function is gone, rename kobject_add_ng()
      to kobject_add() to clean up the namespace.
      
      Cc: Kay Sievers <kay.sievers@vrfy.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      b2d6db58
    • K
      Driver core: convert block from raw kobjects to core devices · edfaa7c3
      Kay Sievers 提交于
      This moves the block devices to /sys/class/block. It will create a
      flat list of all block devices, with the disks and partitions in one
      directory. For compatibility /sys/block is created and contains symlinks
      to the disks.
      
        /sys/class/block
        |-- sda -> ../../devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda
        |-- sda1 -> ../../devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda1
        |-- sda10 -> ../../devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda10
        |-- sda5 -> ../../devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda5
        |-- sda6 -> ../../devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda6
        |-- sda7 -> ../../devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda7
        |-- sda8 -> ../../devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda8
        |-- sda9 -> ../../devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda9
        `-- sr0 -> ../../devices/pci0000:00/0000:00:1f.2/host1/target1:0:0/1:0:0:0/block/sr0
      
        /sys/block/
        |-- sda -> ../devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda
        `-- sr0 -> ../devices/pci0000:00/0000:00:1f.2/host1/target1:0:0/1:0:0:0/block/sr0
      Signed-off-by: NKay Sievers <kay.sievers@vrfy.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      edfaa7c3