sfrench/cifs-2.6.git
16 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6
Linus Torvalds [Fri, 25 Jan 2008 16:38:25 +0000 (08:38 -0800)]
Merge git://git./linux/kernel/git/herbert/crypto-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6: (125 commits)
  [CRYPTO] twofish: Merge common glue code
  [CRYPTO] hifn_795x: Fixup container_of() usage
  [CRYPTO] cast6: inline bloat--
  [CRYPTO] api: Set default CRYPTO_MINALIGN to unsigned long long
  [CRYPTO] tcrypt: Make xcbc available as a standalone test
  [CRYPTO] xcbc: Remove bogus hash/cipher test
  [CRYPTO] xcbc: Fix algorithm leak when block size check fails
  [CRYPTO] tcrypt: Zero axbuf in the right function
  [CRYPTO] padlock: Only reset the key once for each CBC and ECB operation
  [CRYPTO] api: Include sched.h for cond_resched in scatterwalk.h
  [CRYPTO] salsa20-asm: Remove unnecessary dependency on CRYPTO_SALSA20
  [CRYPTO] tcrypt: Add select of AEAD
  [CRYPTO] salsa20: Add x86-64 assembly version
  [CRYPTO] salsa20_i586: Salsa20 stream cipher algorithm (i586 version)
  [CRYPTO] gcm: Introduce rfc4106
  [CRYPTO] api: Show async type
  [CRYPTO] chainiv: Avoid lock spinning where possible
  [CRYPTO] seqiv: Add select AEAD in Kconfig
  [CRYPTO] scatterwalk: Handle zero nbytes in scatterwalk_map_and_copy
  [CRYPTO] null: Allow setkey on digest_null
  ...

16 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-2.6
Linus Torvalds [Fri, 25 Jan 2008 16:34:42 +0000 (08:34 -0800)]
Merge git://git./linux/kernel/git/gregkh/driver-2.6

This can be broken down into these major areas:
 - Documentation updates (language translations and fixes, as
   well as kobject and kset documenatation updates.)
 - major kset/kobject/ktype rework and fixes.  This cleans up the
   kset and kobject and ktype relationship and architecture,
   making sense of things now, and good documenation and samples
   are provided for others to use.  Also the attributes for
   kobjects are much easier to handle now.  This cleaned up a LOT
   of code all through the kernel, making kobjects easier to use
   if you want to.
 - struct bus_type has been reworked to now handle the lifetime
   rules properly, as the kobject is properly dynamic.
 - struct driver has also been reworked, and now the lifetime
   issues are resolved.
 - the block subsystem has been converted to use struct device
   now, and not "raw" kobjects.  This patch has been in the -mm
   tree for over a year now, and finally all the issues are
   worked out with it.  Older distros now properly work with new
   kernels, and no userspace updates are needed at all.
 - nozomi driver is added.  This has also been in -mm for a long
   time, and many people have asked for it to go in.  It is now
   in good enough shape to do so.
 - lots of class_device conversions to use struct device instead.
   The tree is almost all cleaned up now, only SCSI and IB is the
   remaining code to fix up...

* git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-2.6: (196 commits)
  Driver core: coding style fixes
  Kobject: fix coding style issues in kobject c files
  Kobject: fix coding style issues in kobject.h
  Driver core: fix coding style issues in device.h
  spi: use class iteration api
  scsi: use class iteration api
  rtc: use class iteration api
  power supply : use class iteration api
  ieee1394: use class iteration api
  Driver Core: add class iteration api
  Driver core: Cleanup get_device_parent() in device_add() and device_move()
  UIO: constify function pointer tables
  Driver Core: constify the name passed to platform_device_register_simple
  driver core: fix build with SYSFS=n
  sysfs: make SYSFS_DEPRECATED depend on SYSFS
  Driver core: use LIST_HEAD instead of call to INIT_LIST_HEAD in __init
  kobject: add sample code for how to use ksets/ktypes/kobjects
  kobject: add sample code for how to use kobjects in a simple manner.
  kobject: update the kobject/kset documentation
  kobject: remove old, outdated documentation.
  ...

16 years agoslab: fix bootstrap on memoryless node
Pekka Enberg [Fri, 25 Jan 2008 06:20:51 +0000 (08:20 +0200)]
slab: fix bootstrap on memoryless node

If the node we're booting on doesn't have memory, bootstrapping kmalloc()
caches resorts to fallback_alloc() which requires ->nodelists set for all
nodes.  Fix that by calling set_up_list3s() for CACHE_CACHE in
kmem_cache_init().

As kmem_getpages() is called with GFP_THISNODE set, this used to work before
because of breakage in 2.6.22 and before with GFP_THISNODE returning pages from
the wrong node if a node had no memory. So it may have worked accidentally and
in an unsafe manner because the pages would have been associated with the wrong
node which could trigger bug ons and locking troubles.

Tested-by: Mel Gorman <mel@csn.ul.ie>
Tested-by: Olaf Hering <olaf@aepfle.de>
Reviewed-by: Christoph Lameter <clameter@sgi.com>
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
[ With additional one-liner by Olaf Hering  - Linus ]
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agofix oops on rmmod capidrv
Karsten Keil [Fri, 25 Jan 2008 10:55:28 +0000 (11:55 +0100)]
fix oops on rmmod capidrv

Fix overwriting the stack with the version string
(it is currently 10 bytes + zero) when unloading the
capidrv module. Safeguard against overwriting it
should the version string grow in the future.

Should fix Kernel Bug Tracker Bug 9696.

Signed-off-by: Gerd v. Egidy <gerd.von.egidy@intra2net.com>
Acked-by: Karsten Keil <kkeil@suse.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoDriver core: coding style fixes
Greg Kroah-Hartman [Fri, 25 Jan 2008 06:50:12 +0000 (22:50 -0800)]
Driver core: coding style fixes

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: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoKobject: fix coding style issues in kobject c files
Greg Kroah-Hartman [Fri, 25 Jan 2008 05:59:04 +0000 (21:59 -0800)]
Kobject: fix coding style issues in kobject c files

Clean up the kobject.c and kobject_uevent.c files to follow the
proper coding style rules.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoKobject: fix coding style issues in kobject.h
Greg Kroah-Hartman [Fri, 25 Jan 2008 05:27:06 +0000 (21:27 -0800)]
Kobject: fix coding style issues in kobject.h

Finally clean up the odd spaces and other mess in kobject.h

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoDriver core: fix coding style issues in device.h
Greg Kroah-Hartman [Fri, 25 Jan 2008 05:04:46 +0000 (21:04 -0800)]
Driver core: fix coding style issues in device.h

Finally clean up the odd spaces and other mess in device.h

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agospi: use class iteration api
Dave Young [Tue, 22 Jan 2008 07:14:18 +0000 (15:14 +0800)]
spi: use class iteration api

Convert to use the class iteration api.

Signed-off-by: Dave Young <hidave.darkstar@gmail.com>
Acked-by: David Brownell <david-b@pacbell.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoscsi: use class iteration api
Dave Young [Tue, 22 Jan 2008 06:01:34 +0000 (14:01 +0800)]
scsi: use class iteration api

Convert to use the class iteration api.

Signed-off-by: Dave Young <hidave.darkstar@gmail.com>
Cc: James Bottomley <James.Bottomley@hansenpartnership.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agortc: use class iteration api
Dave Young [Tue, 22 Jan 2008 06:00:34 +0000 (14:00 +0800)]
rtc: use class iteration api

Convert to use the class iteration api.

Signed-off-by: Dave Young <hidave.darkstar@gmail.com>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agopower supply : use class iteration api
Dave Young [Tue, 22 Jan 2008 05:58:22 +0000 (13:58 +0800)]
power supply : use class iteration api

Convert to use the class iteration api.

Signed-off-by: Dave Young <hidave.darkstar@gmail.com>
Cc: Anton Vorontsov <cbou@mail.ru>
Cc: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoieee1394: use class iteration api
Dave Young [Tue, 22 Jan 2008 05:56:32 +0000 (13:56 +0800)]
ieee1394: use class iteration api

Convert to use the class iteration api.

Signed-off-by: Dave Young <hidave.darkstar@gmail.com>
Cc: Stefan Richter <stefanr@s5r6.in-berlin.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoDriver Core: add class iteration api
Dave Young [Tue, 22 Jan 2008 07:27:08 +0000 (15:27 +0800)]
Driver Core: add class iteration api

Add the following class iteration functions for driver use:
class_for_each_device
class_find_device
class_for_each_child
class_find_child

Signed-off-by: Dave Young <hidave.darkstar@gmail.com>
Acked-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoDriver core: Cleanup get_device_parent() in device_add() and device_move()
Cornelia Huck [Mon, 21 Jan 2008 15:09:44 +0000 (16:09 +0100)]
Driver core: Cleanup get_device_parent() in device_add() and device_move()

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=2

Signed-off-by: Cornelia 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: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUIO: constify function pointer tables
Jan Engelhardt [Tue, 22 Jan 2008 19:50:54 +0000 (20:50 +0100)]
UIO: constify function pointer tables

Signed-off-by: Jan Engelhardt <jengelh@computergmbh.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoDriver Core: constify the name passed to platform_device_register_simple
Stephen Rothwell [Fri, 11 Jan 2008 06:24:53 +0000 (17:24 +1100)]
Driver Core: constify the name passed to platform_device_register_simple

This name is just passed to platform_device_alloc which has its parameter
declared const.

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agodriver core: fix build with SYSFS=n
Randy Dunlap [Mon, 31 Dec 2007 18:05:43 +0000 (10:05 -0800)]
driver core: fix build with SYSFS=n

When SYSFS=n and MODULES=y, build ends with:

linux-2.6.24-rc6-mm1/drivers/base/module.c: In function 'module_add_driver':
linux-2.6.24-rc6-mm1/drivers/base/module.c:49: error: 'module_kset' undeclared (first use in this function)
make[3]: *** [drivers/base/module.o] Error 1

Below is one possible fix.
Build-tested with all 4 config combinations of SYSFS & MODULES.

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agosysfs: make SYSFS_DEPRECATED depend on SYSFS
Randy Dunlap [Mon, 31 Dec 2007 18:05:34 +0000 (10:05 -0800)]
sysfs: make SYSFS_DEPRECATED depend on SYSFS

Make SYSFS_DEPRECATED depend on SYSFS since files that check
CONFIG_SYSFS_DEPRECATED don't check for CONFIG_SYSFS first.
Also don't prompt user about SYSFS_DEPRECATED if SYSFS=n.

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoDriver core: use LIST_HEAD instead of call to INIT_LIST_HEAD in __init
Denis Cheng [Wed, 5 Dec 2007 18:24:40 +0000 (02:24 +0800)]
Driver core: use LIST_HEAD instead of call to INIT_LIST_HEAD in __init

LIST_HEAD has been widely used, so switch to this simpler method.

Signed-off-by: Denis Cheng <crquan@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agokobject: add sample code for how to use ksets/ktypes/kobjects
Greg Kroah-Hartman [Tue, 27 Nov 2007 19:28:26 +0000 (11:28 -0800)]
kobject: add sample code for how to use ksets/ktypes/kobjects

This is a more complex example showing how to create a kset and a ktype
and some default attributes for a group of kobjects.

Cc: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agokobject: add sample code for how to use kobjects in a simple manner.
Greg Kroah-Hartman [Tue, 27 Nov 2007 19:28:26 +0000 (11:28 -0800)]
kobject: add sample code for how to use kobjects in a simple manner.

This is a simple kobject module, showing how to use kobj_attributes in
basic and more complex ways.

Cc: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agokobject: update the kobject/kset documentation
Greg Kroah-Hartman [Tue, 27 Nov 2007 19:28:26 +0000 (11:28 -0800)]
kobject: update the kobject/kset documentation

This provides a much-needed kobject and kset documentation update.

Thanks to Kay Sievers, Alan Stern, Jonathan Corbet, Randy Dunlap, Jan
Engelhardt, and others for reviewing and providing help with this
document.

Cc: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agokobject: remove old, outdated documentation.
Greg Kroah-Hartman [Tue, 27 Nov 2007 19:28:26 +0000 (11:28 -0800)]
kobject: remove old, outdated documentation.

As we are replacing the documentation, it's easier to do this in a two
stage pass, delete the old file and add the new one.

Cc: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoDriver core: change sysdev classes to use dynamic kobject names
Kay Sievers [Thu, 20 Dec 2007 01:09:39 +0000 (02:09 +0100)]
Driver core: change sysdev classes to use dynamic kobject names

All kobjects require a dynamically allocated name now. We no longer
need to keep track if the name is statically assigned, we can just
unconditionally free() all kobject names on cleanup.

Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoKobject: remove kobject_unregister() as no one uses it anymore
Greg Kroah-Hartman [Thu, 20 Dec 2007 16:13:05 +0000 (08:13 -0800)]
Kobject: remove kobject_unregister() as no one uses it anymore

There are no in-kernel users of kobject_unregister() so it should be
removed.

Cc: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoKobject: convert remaining kobject_unregister() to kobject_put()
Greg Kroah-Hartman [Thu, 20 Dec 2007 16:13:05 +0000 (08:13 -0800)]
Kobject: convert remaining kobject_unregister() to kobject_put()

There is no need for kobject_unregister() anymore, thanks to Kay's
kobject cleanup changes, so replace all instances of it with
kobject_put().

Cc: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoKobject: convert fs/* from kobject_unregister() to kobject_put()
Greg Kroah-Hartman [Thu, 20 Dec 2007 16:13:05 +0000 (08:13 -0800)]
Kobject: convert fs/* from kobject_unregister() to kobject_put()

There is no need for kobject_unregister() anymore, thanks to Kay's
kobject cleanup changes, so replace all instances of it with
kobject_put().

Cc: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoKobject: convert drivers/* from kobject_unregister() to kobject_put()
Greg Kroah-Hartman [Thu, 20 Dec 2007 16:13:05 +0000 (08:13 -0800)]
Kobject: convert drivers/* from kobject_unregister() to kobject_put()

There is no need for kobject_unregister() anymore, thanks to Kay's
kobject cleanup changes, so replace all instances of it with
kobject_put().

Cc: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoKobject: convert arch/* from kobject_unregister() to kobject_put()
Greg Kroah-Hartman [Thu, 20 Dec 2007 16:13:05 +0000 (08:13 -0800)]
Kobject: convert arch/* from kobject_unregister() to kobject_put()

There is no need for kobject_unregister() anymore, thanks to Kay's
kobject cleanup changes, so replace all instances of it with
kobject_put().

Cc: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoModules: remove unneeded release function
Greg Kroah-Hartman [Sun, 23 Dec 2007 05:18:25 +0000 (21:18 -0800)]
Modules: remove unneeded release function

Now that kobjects properly clean up their name structures, no matter if
they have a release function or not, we can drop this empty module
kobject release function too (it was needed prior to this because of the
way we handled static kobject names, we based the fact that if a release
function was present, then we could safely free the name string, now we
are more smart about things and only free names we have previously set.)

Cc: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoKobject: auto-cleanup on final unref
Kay Sievers [Wed, 19 Dec 2007 00:40:42 +0000 (01:40 +0100)]
Kobject: auto-cleanup on final unref

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: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoKset: remove kset_add function
Greg Kroah-Hartman [Tue, 9 Apr 2002 19:14:34 +0000 (12:14 -0700)]
Kset: remove kset_add function

No one is calling this anymore, so just remove it and hard-code the one
internal-use of it.

Cc: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoKobject: remove kobject_register()
Greg Kroah-Hartman [Wed, 19 Dec 2007 19:26:50 +0000 (11:26 -0800)]
Kobject: remove kobject_register()

The function is no longer used by anyone in the kernel, and it prevents
the proper sending of the kobject uevent after the needed files are set
up by the caller.  kobject_init_and_add() can be used in its place.

Cc: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoKobject: rename kobject_init_ng() to kobject_init()
Greg Kroah-Hartman [Tue, 18 Dec 2007 06:05:35 +0000 (23:05 -0700)]
Kobject: rename kobject_init_ng() to kobject_init()

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: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoKobject: remove kobject_init() as no one uses it anymore
Greg Kroah-Hartman [Tue, 18 Dec 2007 06:05:35 +0000 (23:05 -0700)]
Kobject: remove kobject_init() as no one uses it anymore

The old kobject_init() function is on longer in use, so let us remove it
from the public scope (kset mess in the kobject.c file still uses it,
but that can be cleaned up later very simply.)

Cc: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoKobject: rename kobject_add_ng() to kobject_add()
Greg Kroah-Hartman [Tue, 18 Dec 2007 06:05:35 +0000 (23:05 -0700)]
Kobject: rename kobject_add_ng() to kobject_add()

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: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoKobject: remove kobject_add() as no one uses it anymore
Greg Kroah-Hartman [Tue, 18 Dec 2007 06:05:35 +0000 (23:05 -0700)]
Kobject: remove kobject_add() as no one uses it anymore

The old kobject_add() function is on longer in use, so let us remove it
from the public scope (kset mess in the kobject.c file still uses it,
but that can be cleaned up later very simply.)

Cc: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoKobject: convert kernel/module.c to use kobject_init/add_ng()
Greg Kroah-Hartman [Tue, 18 Dec 2007 06:05:35 +0000 (23:05 -0700)]
Kobject: convert kernel/module.c to use kobject_init/add_ng()

This converts the code to use the new kobject functions, cleaning up the
logic in doing so.

Cc: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoKobject: convert drivers/md/md.c to use kobject_init/add_ng()
Greg Kroah-Hartman [Tue, 18 Dec 2007 06:05:35 +0000 (23:05 -0700)]
Kobject: convert drivers/md/md.c to use kobject_init/add_ng()

This converts the code to use the new kobject functions, cleaning up the
logic in doing so.

Cc: Neil Brown <neilb@suse.de>
Cc: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoKobject: convert block/ll_rw_blk.c to use kobject_init/add_ng()
Greg Kroah-Hartman [Tue, 18 Dec 2007 06:05:35 +0000 (23:05 -0700)]
Kobject: convert block/ll_rw_blk.c to use kobject_init/add_ng()

This converts the code to use the new kobject functions, cleaning up the
logic in doing so.

Cc: Jens Axboe <axboe@kernel.dk>
Cc: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoKobject: convert block/elevator.c to use kobject_init/add_ng()
Greg Kroah-Hartman [Tue, 18 Dec 2007 06:05:35 +0000 (23:05 -0700)]
Kobject: convert block/elevator.c to use kobject_init/add_ng()

This converts the code to use the new kobject functions, cleaning up the
logic in doing so.

Cc: Jens Axboe <axboe@kernel.dk>
Cc: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoDriver core: convert block from raw kobjects to core devices
Kay Sievers [Mon, 21 May 2007 20:08:01 +0000 (22:08 +0200)]
Driver core: convert block from raw kobjects to core devices

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: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoKobject: drop child->parent ref at unregistration
Alan Stern [Mon, 19 Nov 2007 15:53:40 +0000 (10:53 -0500)]
Kobject: drop child->parent ref at unregistration

This patch (as1015) reverts changes that were made to the driver core
about four years ago.  The intent back then was to avoid certain kinds
of invalid memory accesses by leaving kernel objects allocated as long
as any of their children were still allocated.  The original and
correct approach was to wait only as long as any children were still
_registered_; that's what this patch reinstates.

This fixes a problem in the SCSI core made visible by the class_device
to regular device conversion: A reference loop (scsi_device holds
reference to request_queue, which is the child of a gendisk, which is
the child of the scsi_device) prevents the data structures from being
released, even though they are deregistered okay.

It's possible that this change will cause a few bugs to surface,
things that have been hidden for several years.  They can be fixed
easily enough by having the child device take an explicit reference to
the parent whenever needed.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Cc: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agosysfs: fix /sys/module/*/holders after sysfs logic change
Kay Sievers [Thu, 29 Nov 2007 22:46:11 +0000 (23:46 +0100)]
sysfs: fix /sys/module/*/holders after sysfs logic change

Sysfs symlinks now require fully registered kobjects as a target,
otherwise the call to create a symlink will fail. Here we register
the kobject before we request the symlink in the holders directory.

Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
Cc: Tejun Heo <teheo@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoDriver core: fix class glue dir cleanup logic
Kay Sievers [Wed, 21 Nov 2007 16:29:15 +0000 (17:29 +0100)]
Driver core: fix class glue dir cleanup logic

We should remove the glue directory between the class and the bus
device _after_ we sent out the 'remove' event for the device, otherwise
the parent relationship is no longer valid, and composing the path
with deleted sysfs entries will not work.

Cc: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoDriver core: fix race in __device_release_driver
Alan Stern [Fri, 16 Nov 2007 16:57:28 +0000 (11:57 -0500)]
Driver core: fix race in __device_release_driver

This patch (as1013) was suggested by David Woodhouse; it fixes a race
in the driver core.  If a device is unregistered at the same time as
its driver is unloaded, the driver's code pages may be unmapped while
the remove method is still running.  The calls to get_driver() and
put_driver() were intended to prevent this, but they don't work if the
driver's module count has already dropped to 0.

Instead, the patch keeps the device on the driver's list until after
the remove method has returned.  This forces the necessary
synchronization to occur.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoKobject: change drivers/base/bus to use kobject_init_and_add
Greg Kroah-Hartman [Mon, 17 Dec 2007 19:54:39 +0000 (15:54 -0400)]
Kobject: change drivers/base/bus to use kobject_init_and_add

Stop using kobject_register, as this way we can control the sending of
the uevent properly, after everything is properly initialized.

Cc: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoDriver core: clean up debugging messages
Greg Kroah-Hartman [Thu, 29 Nov 2007 07:49:41 +0000 (23:49 -0800)]
Driver core: clean up debugging messages

The driver core debugging messages are a mess.  This provides a unified
message that makes them actually useful.

The format for new kobject debug messages should be:
driver/bus/class: 'OBJECT_NAME': FUNCTION_NAME: message.\n

Note, the class code is not changed in this patch due to pending patches
in my queue that this would conflict with.  A later patch will clean
them up.

Cc: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoDriver core: move the static kobject out of struct driver
Greg Kroah-Hartman [Wed, 28 Nov 2007 23:59:15 +0000 (15:59 -0800)]
Driver core: move the static kobject out of struct driver

This patch removes the kobject, and a few other driver-core-only fields
out of struct driver and into the driver core only.  Now drivers can be
safely create on the stack or statically (like they currently are.)

Cc: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoDriver core: move the driver specific module code into the driver core
Greg Kroah-Hartman [Wed, 28 Nov 2007 20:23:18 +0000 (12:23 -0800)]
Driver core: move the driver specific module code into the driver core

The module driver specific code should belong in the driver core, not in
the kernel/ directory.  So move this code.  This is done in preparation
for some struct device_driver rework that should be confined to the
driver core code only.

This also lets us keep from exporting these functions, as no external
code should ever be calling it.

Thanks to Andrew Morton for the !CONFIG_MODULES fix.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoDriver: add driver_add_kobj for looney iseries_veth driver
Greg Kroah-Hartman [Wed, 19 Dec 2007 19:54:39 +0000 (15:54 -0400)]
Driver: add driver_add_kobj for looney iseries_veth driver

The iseries driver wants to hang kobjects off of its driver, so, to
preserve backwards compatibility, we need to add a call to the driver
core to allow future changes to work properly.

Hopefully no one uses this function in the future and the iseries_veth
driver authors come to their senses so I can remove this hack...

Cc: Dave Larson <larson1@us.ibm.com>
Cc: Santiago Leon <santil@us.ibm.com>
Cc: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoInfiniband: make ipath driver use default driver groups.
Greg Kroah-Hartman [Wed, 5 Dec 2007 06:53:16 +0000 (22:53 -0800)]
Infiniband: make ipath driver use default driver groups.

Make the ipath driver use the new driver functions so that it does not
touch the sysfs portion of the driver structure.

We also remove the redundant symlink from the device back to the driver,
as it is already in the sysfs tree.  Any userspace tools should be using
the standard symlink, not some driver specific one.

Cc: Roland Dreier <rdreier@cisco.com>
Cc: Bryan O'Sullivan <bryan.osullivan@qlogic.com>
Cc: Arthur Jones <arthur.jones@qlogic.com>
Cc: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agozfcp: Use device_driver default attribute groups.
Cornelia Huck [Wed, 5 Dec 2007 11:50:31 +0000 (12:50 +0100)]
zfcp: Use device_driver default attribute groups.

CC: Swen Schillig <swen@vnet.ibm.com>
Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agonetiucv: Use device_driver default attribute groups.
Cornelia Huck [Wed, 5 Dec 2007 11:50:28 +0000 (12:50 +0100)]
netiucv: Use device_driver default attribute groups.

CC: Ursula Braun <ubraun@linux.vnet.ibm.com>
Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agodriver core: Introduce default attribute groups.
Cornelia Huck [Wed, 5 Dec 2007 11:50:23 +0000 (12:50 +0100)]
driver core: Introduce default attribute groups.

This is lot like default attributes for devices (and indeed,
a lot of the code is lifted from there).

Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoPCI: remove foolish code from pci-driver.c
Greg Kroah-Hartman [Wed, 28 Nov 2007 20:23:18 +0000 (12:23 -0800)]
PCI: remove foolish code from pci-driver.c

The PCI bus should not be trying to declare its own attribute type.
Especially as this code could never ever be called because the driver
core overwrites the driver kobject type to be its own internal type.
Delete all of this code as it was never being used and is not correct.

Also update my copyright on the file while I'm touching things there.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoPCI: use proper call to driver_create_file
Greg Kroah-Hartman [Wed, 28 Nov 2007 20:23:18 +0000 (12:23 -0800)]
PCI: use proper call to driver_create_file

Don't try to call the "raw" sysfs_create_file when we already have a
helper function to do this kind of work for us.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoPCMCIA: use proper call to driver_create_file
Greg Kroah-Hartman [Wed, 28 Nov 2007 20:23:18 +0000 (12:23 -0800)]
PCMCIA: use proper call to driver_create_file

Don't try to call the "raw" sysfs_create_file when we already have a
helper function to do this kind of work for us.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: use proper call to driver_create_file
Greg Kroah-Hartman [Wed, 28 Nov 2007 20:23:18 +0000 (12:23 -0800)]
USB: use proper call to driver_create_file

Don't try to call the "raw" sysfs_create_file when we already have a
helper function to do this kind of work for us.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agodriver core: remove fields from struct bus_type
Greg Kroah-Hartman [Fri, 2 Nov 2007 02:41:16 +0000 (19:41 -0700)]
driver core: remove fields from struct bus_type

struct bus_type is static everywhere in the kernel.  This moves the
kobject in the structure out of it, and a bunch of other private only to
the driver core fields are now moved to a private structure.  This lets
us dynamically create the backing kobject properly and gives us the
chance to be able to document to users exactly how to use the struct
bus_type as there are no fields they can improperly access.

Thanks to Kay for the build fixes on this patch.

Cc: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agodriver core: add way to get to bus device klist
Greg Kroah-Hartman [Fri, 2 Nov 2007 02:41:16 +0000 (19:41 -0700)]
driver core: add way to get to bus device klist

This allows an easier way to get to the device klist associated with a
struct bus_type (you have three to choose from...)  This will make it
easier to move these fields to be dynamic in a future patch.

The only user of this is the PCI core which horribly abuses this
interface to rearrange the order of the pci devices.  This should be
done using the existing bus device walking functions, but that's left
for future patches.

Cc: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agodriver core: add way to get to bus kset
Greg Kroah-Hartman [Fri, 2 Nov 2007 02:41:16 +0000 (19:41 -0700)]
driver core: add way to get to bus kset

This allows an easier way to get to the kset associated with a struct
bus_type (you have three to choose from...)  This will make it easier to
move these fields to be dynamic in a future patch.

Cc: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agodriver core: remove owner field from struct bus_type
Greg Kroah-Hartman [Thu, 1 Nov 2007 20:31:26 +0000 (13:31 -0700)]
driver core: remove owner field from struct bus_type

This isn't used by anything in the driver core, and by no one in the 204
different usages of it in the kernel tree.  Remove this field so no one
gets any idea that it is needed to be used.

Cc: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoKobject: convert net/bridge/br_if.c to use kobject_init/add_ng()
Greg Kroah-Hartman [Tue, 18 Dec 2007 06:05:35 +0000 (23:05 -0700)]
Kobject: convert net/bridge/br_if.c to use kobject_init/add_ng()

This converts the code to use the new kobject functions, cleaning up the
logic in doing so.

Cc: Stephen Hemminger <shemminger@linux-foundation.org>
Cc: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoKobject: convert mm/slub.c to use kobject_init/add_ng()
Greg Kroah-Hartman [Tue, 18 Dec 2007 06:05:35 +0000 (23:05 -0700)]
Kobject: convert mm/slub.c to use kobject_init/add_ng()

This converts the code to use the new kobject functions, cleaning up the
logic in doing so.

Cc: Christoph Lameter <clameter@sgi.com>
Cc: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoKobject: convert kernel/user.c to use kobject_init/add_ng()
Greg Kroah-Hartman [Tue, 18 Dec 2007 06:05:35 +0000 (23:05 -0700)]
Kobject: convert kernel/user.c to use kobject_init/add_ng()

This converts the code to use the new kobject functions, cleaning up the
logic in doing so.

Cc: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoKobject: convert kernel/params.c to use kobject_init/add_ng()
Greg Kroah-Hartman [Tue, 18 Dec 2007 06:05:35 +0000 (23:05 -0700)]
Kobject: convert kernel/params.c to use kobject_init/add_ng()

This converts the code to use the new kobject functions, cleaning up the
logic in doing so.

Cc: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoKobject: convert fs/char_dev.c to use kobject_init/add_ng()
Greg Kroah-Hartman [Tue, 18 Dec 2007 06:05:35 +0000 (23:05 -0700)]
Kobject: convert fs/char_dev.c to use kobject_init/add_ng()

This converts the code to use the new kobject functions, cleaning up the
logic in doing so.

Cc: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoKobject: convert drivers/net/iseries_veth.c to use kobject_init/add_ng()
Greg Kroah-Hartman [Tue, 18 Dec 2007 06:05:35 +0000 (23:05 -0700)]
Kobject: convert drivers/net/iseries_veth.c to use kobject_init/add_ng()

This converts the code to use the new kobject functions, cleaning up the
logic in doing so.

Cc: Kyle A. Lucke <klucke@us.ibm.com>
Cc: David Gibson <dwg@au1.ibm.com>
Cc: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoKobject: convert drivers/base/core.c to use kobject_init/add_ng()
Greg Kroah-Hartman [Tue, 18 Dec 2007 06:05:35 +0000 (23:05 -0700)]
Kobject: convert drivers/base/core.c to use kobject_init/add_ng()

This converts the code to use the new kobject functions, cleaning up the
logic in doing so.

Cc: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoKobject: convert drivers/base/class.c to use kobject_init/add_ng()
Greg Kroah-Hartman [Tue, 18 Dec 2007 06:05:35 +0000 (23:05 -0700)]
Kobject: convert drivers/base/class.c to use kobject_init/add_ng()

This converts the code to use the new kobject functions, cleaning up the
logic in doing so.

Cc: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoKobject: the cris iop_fw_load.c code is broken
Greg Kroah-Hartman [Tue, 18 Dec 2007 06:05:35 +0000 (23:05 -0700)]
Kobject: the cris iop_fw_load.c code is broken

This code is really really really broken.  So much so that it's almost
impossible to fix with a simple patch, so just comment out the offending
registration with the kobject core, and mark the driver as broken.

The problem is that the code is trying to register a "raw" struct
device, which is not allowed.  struct device is only for use within the
driver model.  This is being done to try to use the firmware layer which
wants a struct device.  To properly fix this, use something easy, like a
platform device, which is a struct device and can be used for this kind
of thing.

Cc: Mikael Starvik <starvik@axis.com>
Cc: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoKobject: change arch/x86/kernel/cpu/mcheck/mce_amd_64.c to use kobject_init_and_add
Greg Kroah-Hartman [Wed, 19 Dec 2007 17:23:20 +0000 (09:23 -0800)]
Kobject: change arch/x86/kernel/cpu/mcheck/mce_amd_64.c to use kobject_init_and_add

Stop using kobject_register, as this way we can control the sending of
the uevent properly, after everything is properly initialized.

Cc: Jacob Shin <jacob.shin@amd.com>
Cc: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoKobject: change arch/x86/kernel/cpu/mcheck/mce_amd_64.c to use kobject_create_and_add
Greg Kroah-Hartman [Wed, 19 Dec 2007 17:23:20 +0000 (09:23 -0800)]
Kobject: change arch/x86/kernel/cpu/mcheck/mce_amd_64.c to use kobject_create_and_add

Make this kobject dynamic and convert it to not use kobject_register,
which is going away.

Cc: Jacob Shin <jacob.shin@amd.com>
Cc: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoKobject: change drivers/md/md.c to use kobject_init_and_add
Greg Kroah-Hartman [Mon, 17 Dec 2007 19:54:39 +0000 (15:54 -0400)]
Kobject: change drivers/md/md.c to use kobject_init_and_add

Stop using kobject_register, as this way we can control the sending of
the uevent properly, after everything is properly initialized.

Cc: Neil Brown <neilb@suse.de>
Cc: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoKobject: change arch/ia64/kernel/topology.c to use kobject_init_and_add
Greg Kroah-Hartman [Mon, 17 Dec 2007 19:54:39 +0000 (15:54 -0400)]
Kobject: change arch/ia64/kernel/topology.c to use kobject_init_and_add

Stop using kobject_register, as this way we can control the sending of
the uevent properly, after everything is properly initialized.

Cc: Tony Luck <tony.luck@intel.com>
Cc: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoKobject: change drivers/parisc/pdc_stable.c to use kobject_init_and_add
Greg Kroah-Hartman [Mon, 17 Dec 2007 19:54:39 +0000 (15:54 -0400)]
Kobject: change drivers/parisc/pdc_stable.c to use kobject_init_and_add

Stop using kobject_register, as this way we can control the sending of
the uevent properly, after everything is properly initialized.

Cc: Kyle McMartin <kyle@parisc-linux.org>
Cc: Matthew Wilcox <matthew@wil.cx>
Cc: Grant Grundler <grundler@parisc-linux.org>
Cc: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoKobject: change drivers/net/ibmveth.c to use kobject_init_and_add
Greg Kroah-Hartman [Mon, 17 Dec 2007 19:54:39 +0000 (15:54 -0400)]
Kobject: change drivers/net/ibmveth.c to use kobject_init_and_add

Stop using kobject_register, as this way we can control the sending of
the uevent properly, after everything is properly initialized.

Cc: Dave Larson <larson1@us.ibm.com>
Cc: Santiago Leon <santil@us.ibm.com>
Cc: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoKobject: change arch/sh/kernel/cpu/sh4/sq.c to use kobject_init_and_add
Greg Kroah-Hartman [Mon, 17 Dec 2007 19:54:39 +0000 (15:54 -0400)]
Kobject: change arch/sh/kernel/cpu/sh4/sq.c to use kobject_init_and_add

Stop using kobject_register, as this way we can control the sending of
the uevent properly, after everything is properly initialized.

Cc: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoKobject: change drivers/block/pktcdvd.c to use kobject_init_and_add
Greg Kroah-Hartman [Mon, 17 Dec 2007 19:54:39 +0000 (15:54 -0400)]
Kobject: change drivers/block/pktcdvd.c to use kobject_init_and_add

Stop using kobject_register, as this way we can control the sending of
the uevent properly, after everything is properly initialized.

Cc: Jens Axboe <axboe@kernel.dk>
Cc: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoKobject: change drivers/acpi/system.c to use kobject_create_and_add
Greg Kroah-Hartman [Mon, 17 Dec 2007 19:54:39 +0000 (15:54 -0400)]
Kobject: change drivers/acpi/system.c to use kobject_create_and_add

Stop using kobject_register for this static kobject, as it's overkill.
This way is much simpler.

Cc: Len Brown <len.brown@intel.com>
Cc: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoKobject: change arch/x86/kernel/cpu/intel_cacheinfo.c to use kobject_init_and_add
Greg Kroah-Hartman [Mon, 17 Dec 2007 19:54:39 +0000 (15:54 -0400)]
Kobject: change arch/x86/kernel/cpu/intel_cacheinfo.c to use kobject_init_and_add

Stop using kobject_register, as this way we can control the sending of
the uevent properly, after everything is properly initialized.

Cc: Ashok Raj <ashok.raj@intel.com>
Cc: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoKobject: change drivers/base/sys.c to use kobject_init_and_add
Greg Kroah-Hartman [Mon, 17 Dec 2007 19:54:39 +0000 (15:54 -0400)]
Kobject: change drivers/base/sys.c to use kobject_init_and_add

Stop using kobject_register, as this way we can control the sending of
the uevent properly, after everything is properly initialized.

Cc: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoKobject: change drivers/pci/hotplug/pci_hotplug_core.c to use kobject_init_and_add
Greg Kroah-Hartman [Mon, 17 Dec 2007 19:54:39 +0000 (15:54 -0400)]
Kobject: change drivers/pci/hotplug/pci_hotplug_core.c to use kobject_init_and_add

Stop using kobject_register, as this way we can control the sending of
the uevent properly, after everything is properly initialized.

Cc: Kristen Carlson Accardi <kristen.c.accardi@intel.com>
Cc: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoKobject: change drivers/cpuidle/sysfs.c to use kobject_init_and_add
Greg Kroah-Hartman [Mon, 17 Dec 2007 19:54:39 +0000 (15:54 -0400)]
Kobject: change drivers/cpuidle/sysfs.c to use kobject_init_and_add

Stop using kobject_register, as this way we can control the sending of
the uevent properly, after everything is properly initialized.

Cc: Shaohua Li <shaohua.li@intel.com>
Cc: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoKobject: change drivers/edac to use kobject_init_and_add
Greg Kroah-Hartman [Mon, 17 Dec 2007 19:54:39 +0000 (15:54 -0400)]
Kobject: change drivers/edac to use kobject_init_and_add

Stop using kobject_register, as this way we can control the sending of
the uevent properly, after everything is properly initialized.

Acked-by: Doug Thompson <dougthompson@xmission.com>
Cc: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoKobject: change drivers/cpufreq/cpufreq.c to use kobject_init_and_add
Greg Kroah-Hartman [Mon, 17 Dec 2007 19:54:39 +0000 (15:54 -0400)]
Kobject: change drivers/cpufreq/cpufreq.c to use kobject_init_and_add

Stop using kobject_register, as this way we can control the sending of
the uevent properly, after everything is properly initialized.

Cc: Dominik Brodowski <linux@brodo.de>
Cc: Ashok Raj <ashok.raj@intel.com>
Cc: Jacob Shin <jacob.shin@amd.com>
Cc: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoKobject: change drivers/firmware/efivars.c to use kobject_init_and_add
Greg Kroah-Hartman [Mon, 17 Dec 2007 19:54:39 +0000 (15:54 -0400)]
Kobject: change drivers/firmware/efivars.c to use kobject_init_and_add

Stop using kobject_register, as this way we can control the sending of
the uevent properly, after everything is properly initialized.

Cc: Matt Domsch <Matt_Domsch@dell.com>
Cc: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoKobject: change drivers/firmware/edd.c to use kobject_init_and_add
Greg Kroah-Hartman [Mon, 17 Dec 2007 19:54:39 +0000 (15:54 -0400)]
Kobject: change drivers/firmware/edd.c to use kobject_init_and_add

Stop using kobject_register, as this way we can control the sending of
the uevent properly, after everything is properly initialized.

Cc: Matt Domsch <Matt_Domsch@dell.com>
Cc: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoKobject: change drivers/infiniband to use kobject_init_and_add
Greg Kroah-Hartman [Mon, 17 Dec 2007 19:54:39 +0000 (15:54 -0400)]
Kobject: change drivers/infiniband to use kobject_init_and_add

Stop using kobject_register, as this way we can control the sending of
the uevent properly, after everything is properly initialized.

Cc: Roland Dreier <rolandd@cisco.com>
Cc: Sean Hefty <mshefty@ichips.intel.com>
Cc: Hal Rosenstock <hal.rosenstock@gmail.com>
Cc: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoKobject: change GFS2 to use kobject_init_and_add
Greg Kroah-Hartman [Mon, 17 Dec 2007 19:54:39 +0000 (15:54 -0400)]
Kobject: change GFS2 to use kobject_init_and_add

Stop using kobject_register, as this way we can control the sending of
the uevent properly, after everything is properly initialized.

Cc: Steven Whitehouse <swhiteho@redhat.com>
Cc: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoKobject: change net/bridge to use kobject_create_and_add
Greg Kroah-Hartman [Mon, 17 Dec 2007 19:54:39 +0000 (15:54 -0400)]
Kobject: change net/bridge to use kobject_create_and_add

The kobject in the bridge code is only used for registering with sysfs,
not for any lifespan rules.  This patch changes it to be only a pointer
and use the simpler api for this kind of thing.

Cc: Stephen Hemminger <shemminger@linux-foundation.org>
Cc: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUIO: fix kobject usage
Greg Kroah-Hartman [Tue, 4 Dec 2007 22:41:54 +0000 (22:41 +0000)]
UIO: fix kobject usage

The uio kobject code is "wierd".  This patch should hopefully fix it up
to be sane and not leak memory anymore.

Cc: Kay Sievers <kay.sievers@vrfy.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Benedikt Spranger <b.spranger@linutronix.de>
Signed-off-by: Hans J. Koch <hjk@linutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agokobject: clean up debugging messages
Greg Kroah-Hartman [Thu, 29 Nov 2007 07:49:41 +0000 (23:49 -0800)]
kobject: clean up debugging messages

The kobject debugging messages are a mess.  This provides a unified
message that makes them actually useful.

The format for new kobject debug messages should be:
kobject: 'KOBJECT_NAME' (ADDRESS): FUNCTION_NAME: message.\n

Cc: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agokobject: grab the kset reference in kobject_add, not kobject_init
Greg Kroah-Hartman [Wed, 28 Nov 2007 18:46:22 +0000 (10:46 -0800)]
kobject: grab the kset reference in kobject_add, not kobject_init

kobject_init should not be grabing any references, but only initializing
the object.  This patch fixes this, and makes the lock hold-time shorter
for when a kset is present in the kobject.

The current kernel tree has been audited to verify that this change
should be safe.

Cc: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agodriver core: make /sys/power a kobject
Greg Kroah-Hartman [Tue, 27 Nov 2007 19:28:26 +0000 (11:28 -0800)]
driver core: make /sys/power a kobject

/sys/power should not be a kset, that's overkill.  This patch renames it
to power_kset and fixes up all usages of it in the tree.

Cc: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agodriver core: clean up device_shutdown
Greg Kroah-Hartman [Tue, 27 Nov 2007 06:11:55 +0000 (22:11 -0800)]
driver core: clean up device_shutdown

device_shutdown does not need to be in a separate file.  Move it into
the driver core file where it belongs.

This also moves us one more step closer to making devices_kset static,
now only the crazy sysdevs are keeping that from happening...

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agodriver core: clean up shutdown.c
Greg Kroah-Hartman [Tue, 20 Nov 2007 21:56:21 +0000 (13:56 -0800)]
driver core: clean up shutdown.c

shutdown.c had some stuff it did not need, including a duplicate extern
in the power.h file.  This cleans up all of that.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agokobject: convert parisc/pdc_stable to use kobject_create
Greg Kroah-Hartman [Wed, 7 Nov 2007 21:56:19 +0000 (13:56 -0800)]
kobject: convert parisc/pdc_stable to use kobject_create

Using a kset for this simple directory is an overkill.

Cc: Kay Sievers <kay.sievers@vrfy.org>
Cc: Thibaut VARENE <varenet@parisc-linux.org>
Cc: Matthew Wilcox <matthew@wil.cx>
Cc: Grant Grundler <grundler@parisc-linux.org>
Cc: Kyle McMartin <kyle@parisc-linux.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>