1. 19 Nov, 2002 10 commits
    • Patrick Mochel's avatar
      driver model: exploit kobject contstructs. · b12cf4ff
      Patrick Mochel authored
      This makes the driver model core (for devices) exploit the kobject
      infrastructure more and make the resulting code quite a bit simpler. 
      
      For one, device_register() mimmicks kobject_register() in that it now only
      calls device_initialize() and device_add() back to back. Similarly, 
      device_unregister() calls device_del() and put_device() consecutively. 
      
      device_del() no longer removes and frees the device, it only removes them.
      It also removes the devices from the global and sibling lists. This was 
      previously done by device_put(), but moved here to be symmetrical with 
      device_add().
      
      The device's parent is now only incremented in device_add() and decremented
      in device_del(), fixing a bug in which the parent's refcount was incremented
      twice. 
      
      Because of these simplifications, the core can easily be converted to use 
      the kobject reference counting infrastructure. get_device() now simply 
      forwards the call to kobject_get() and ditto for put_device(). 
      device_release() is implemented to handle the freeing of devices once their
      reference count reaches 0.
      
      Since we're using the kobject refcounting model, we no longer need the 
      checking or setting of the device state field, so it has been removed. 
      The only users of it were the power routines. In those, it is implicit that
      we have a valid device, since we've already taken device_sem, and we're 
      walking the list (all modifications are protected by device_sem).
      
      struct device::lock, and the helpers to lock/unlock have been removed. No
      one has ever used them, and no one is likely to use them.
      b12cf4ff
    • Patrick Mochel's avatar
      merge · ca01359a
      Patrick Mochel authored
      ca01359a
    • Patrick Mochel's avatar
      sysfs: do permission checking on open. · 0de8c962
      Patrick Mochel authored
      sysfs has always had a bug that would allow a read-only file to be opened 
      for writing. It has also returned 0 on write when there was no store method
      defined for the file. 
      
      This addresses both via sysfs_open_file(). It checks the flags the file was
      opened with and compares them with the mode of the inode. If the mode does
      not support the flags passed, -EPERM is returned.
      
      If the sysfs_ops for the object does not have the correct method for the 
      flags, -EACCESS is returned. 
      
      Since all checks happen on open(), the corresponding checks in the read()
      and write() methods have been removed. 
      0de8c962
    • Patrick Mochel's avatar
      Merge osdl.org:/home/mochel/src/kernel/devel/linux-2.5-virgin · bb4be78a
      Patrick Mochel authored
      into osdl.org:/home/mochel/src/kernel/devel/linux-2.5-kobject
      bb4be78a
    • Linus Torvalds's avatar
      Broken applications do not realize that a zero return · fdea9fc9
      Linus Torvalds authored
      from "write()" is an error condition, and hang retrying.
      
      Return EINVAL in sysfs instead.
      fdea9fc9
    • Linus Torvalds's avatar
      Merge master.kernel.org:/home/dwmw2/BK/jffs2-forlinus-2.5 · 6f2a9d7b
      Linus Torvalds authored
      into home.transmeta.com:/home/torvalds/v2.5/linux
      6f2a9d7b
    • David Woodhouse's avatar
      Fix nanosecond merge. · 44ef2d6a
      David Woodhouse authored
      44ef2d6a
    • David Woodhouse's avatar
      20fed049
    • Andries E. Brouwer's avatar
      [PATCH] compilation fix (tpyo) · 274c7da7
      Andries E. Brouwer authored
      274c7da7
    • Ben Fennema's avatar
      715feb63
  2. 18 Nov, 2002 30 commits