]> git.hungrycats.org Git - linux/commit
driver model: fix device interfaces.
authorPatrick Mochel <mochel@osdl.org>
Mon, 3 Mar 2003 06:48:38 +0000 (00:48 -0600)
committerPatrick Mochel <mochel@osdl.org>
Mon, 3 Mar 2003 06:48:38 +0000 (00:48 -0600)
commit2e646ed096850667d67db5d86070dc2b6c136677
tree61f722ac1ae4fdc6c4160d8c03985359764236d4
parentad5429c74ca331087f02f336e6cbc8fabad53043
driver model: fix device interfaces.

- Remove struct intf_data.
  It was silly, and gave us an unbalanced interface.
  Instead, when removing a device_interface, all of a class's devices are
  iterated over, and intf->remove_device() is called for each. (Instead
  of the device's list of interfaces it belongs to).
  Interfaces are expected to tell if they support the device being removed.

- Remove struct device::intf_list.

- Protect classes' device list access with devclass_sem, which is taken
  when a device or interface is added or removed. This allows access to the
  list w/o taking the class's lock, which allows subordinate objects to be
  registered (e.g. the interface itself, or objects the interfaces create
  for a device).

- This should fix a deadlock when devices are added to interfaces, which
  calls intf->add_device(), then interface_add_data(), which call
  kobject_register() and hangs, since it tries to take the class's lock
  again.
drivers/base/base.h
drivers/base/class.c
drivers/base/core.c
drivers/base/intf.c
include/linux/device.h