]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
Driver core: change sysdev classes to use dynamic kobject names
authorKay Sievers <kay.sievers@vrfy.org>
Thu, 20 Dec 2007 01:09:39 +0000 (02:09 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 25 Jan 2008 04:40:40 +0000 (20:40 -0800)
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>
55 files changed:
arch/arm/kernel/time.c
arch/arm/mach-integrator/integrator_ap.c
arch/arm/mach-pxa/cm-x270.c
arch/arm/mach-pxa/lpd270.c
arch/arm/mach-pxa/lubbock.c
arch/arm/mach-pxa/mainstone.c
arch/arm/mach-s3c2410/s3c2410.c
arch/arm/mach-s3c2412/s3c2412.c
arch/arm/mach-s3c2440/mach-osiris.c
arch/arm/mach-s3c2443/s3c2443.c
arch/arm/mach-sa1100/irq.c
arch/arm/oprofile/common.c
arch/arm/plat-omap/gpio.c
arch/arm/plat-s3c24xx/dma.c
arch/arm/plat-s3c24xx/s3c244x.c
arch/avr32/kernel/time.c
arch/mips/kernel/i8259.c
arch/powerpc/platforms/cell/spu_base.c
arch/powerpc/platforms/powermac/pic.c
arch/powerpc/sysdev/ipic.c
arch/powerpc/sysdev/mpic.c
arch/powerpc/sysdev/qe_lib/qe_ic.c
arch/ppc/syslib/ipic.c
arch/ppc/syslib/open_pic.c
arch/ppc/syslib/open_pic2.c
arch/s390/kernel/time.c
arch/sh/drivers/dma/dma-sysfs.c
arch/sh/kernel/time.c
arch/x86/kernel/apic_32.c
arch/x86/kernel/apic_64.c
arch/x86/kernel/cpu/mcheck/mce_64.c
arch/x86/kernel/i8237.c
arch/x86/kernel/i8259_32.c
arch/x86/kernel/i8259_64.c
arch/x86/kernel/io_apic_32.c
arch/x86/kernel/io_apic_64.c
arch/x86/kernel/nmi_32.c
arch/x86/kernel/nmi_64.c
arch/x86/oprofile/nmi_int.c
drivers/acpi/pci_link.c
drivers/base/class.c
drivers/base/cpu.c
drivers/base/memory.c
drivers/base/node.c
drivers/base/sys.c
drivers/edac/edac_module.c
drivers/kvm/kvm_main.c
drivers/macintosh/via-pmu.c
drivers/scsi/libsas/sas_scsi_host.c
include/linux/kobject.h
include/linux/sysdev.h
kernel/rtmutex-tester.c
kernel/time/clocksource.c
kernel/time/timekeeping.c
lib/kobject.c

index 1533d3ecd7a05b71b559f56356560a37daabefcf..f6f3689a86ee2e10b99e7dfca154c98713b16971 100644 (file)
@@ -195,7 +195,7 @@ static int leds_shutdown(struct sys_device *dev)
 }
 
 static struct sysdev_class leds_sysclass = {
-       set_kset_name("leds"),
+       .name           = "leds",
        .shutdown       = leds_shutdown,
        .suspend        = leds_suspend,
        .resume         = leds_resume,
@@ -369,7 +369,7 @@ static int timer_resume(struct sys_device *dev)
 #endif
 
 static struct sysdev_class timer_sysclass = {
-       set_kset_name("timer"),
+       .name           = "timer",
        .suspend        = timer_suspend,
        .resume         = timer_resume,
 };
index 72280754354d3b98e7785c945abd0ec33930202c..df37e93c6fc92e51826fbf1c669c585b5d5d105f 100644 (file)
@@ -214,7 +214,7 @@ static int irq_resume(struct sys_device *dev)
 #endif
 
 static struct sysdev_class irq_class = {
-       set_kset_name("irq"),
+       .name           = "irq",
        .suspend        = irq_suspend,
        .resume         = irq_resume,
 };
index 177664ccb2e230ab954fcbbdbf9913a6de499d88..a16349272f54db89e1c7fbfa1a846c57f2430047 100644 (file)
@@ -566,7 +566,7 @@ static int cmx270_resume(struct sys_device *dev)
 }
 
 static struct sysdev_class cmx270_pm_sysclass = {
-       set_kset_name("pm"),
+       .name = "pm",
        .resume = cmx270_resume,
        .suspend = cmx270_suspend,
 };
index 26116440a7c927648d7b8a3e493bdf042cab3beb..78ebad063cba59bb9ef58ddb8918869411cc9e87 100644 (file)
@@ -122,7 +122,7 @@ static int lpd270_irq_resume(struct sys_device *dev)
 }
 
 static struct sysdev_class lpd270_irq_sysclass = {
-       set_kset_name("cpld_irq"),
+       .name = "cpld_irq",
        .resume = lpd270_irq_resume,
 };
 
index 011a1a72b61c87241d15f3515facfb9c7917cd3f..1d3112dc629ea38a76f203adac5f96affe6b0f20 100644 (file)
@@ -126,7 +126,7 @@ static int lubbock_irq_resume(struct sys_device *dev)
 }
 
 static struct sysdev_class lubbock_irq_sysclass = {
-       set_kset_name("cpld_irq"),
+       .name = "cpld_irq",
        .resume = lubbock_irq_resume,
 };
 
index a4bc3483cbb3f29540739f5268dedc02b21f7972..41d8c6cea62b4d26285f22a9eb23479bdcc5a501 100644 (file)
@@ -120,7 +120,7 @@ static int mainstone_irq_resume(struct sys_device *dev)
 }
 
 static struct sysdev_class mainstone_irq_sysclass = {
-       set_kset_name("cpld_irq"),
+       .name = "cpld_irq",
        .resume = mainstone_irq_resume,
 };
 
index e580303cb0abbd86d1e97429ea21fceaeeb0efec..0e7991940f81b040c88ca73d5501038c3d69fbc8 100644 (file)
@@ -100,7 +100,7 @@ void __init s3c2410_init_clocks(int xtal)
 }
 
 struct sysdev_class s3c2410_sysclass = {
-       set_kset_name("s3c2410-core"),
+       .name = "s3c2410-core",
 };
 
 static struct sys_device s3c2410_sysdev = {
index 4f92a1562d77fa62043e5d4a29679a8d928a612d..265cd3f567a3fe164bbe9027cd2856120e725dd9 100644 (file)
@@ -196,7 +196,7 @@ void __init s3c2412_init_clocks(int xtal)
 */
 
 struct sysdev_class s3c2412_sysclass = {
-       set_kset_name("s3c2412-core"),
+       .name = "s3c2412-core",
 };
 
 static int __init s3c2412_core_init(void)
index c326983f4a8f5b66dcee243def28998c560d2bb2..78af7664988b98746f1499a79dd142a0fb33b5fd 100644 (file)
@@ -312,7 +312,7 @@ static int osiris_pm_resume(struct sys_device *sd)
 #endif
 
 static struct sysdev_class osiris_pm_sysclass = {
-       set_kset_name("mach-osiris"),
+       .name           = "mach-osiris",
        .suspend        = osiris_pm_suspend,
        .resume         = osiris_pm_resume,
 };
index 8d8117158d23aa5d9e22b59bbd7db5abfe67d805..9ce490560af98df561a7742a858515c17cc063fd 100644 (file)
@@ -43,7 +43,7 @@ static struct map_desc s3c2443_iodesc[] __initdata = {
 };
 
 struct sysdev_class s3c2443_sysclass = {
-       set_kset_name("s3c2443-core"),
+       .name = "s3c2443-core",
 };
 
 static struct sys_device s3c2443_sysdev = {
index edf3347d9c5b61bccce6859cc0fcde6fc935964b..3dc17d7bf38e823f407c05e30f1af20d8ae2022d 100644 (file)
@@ -283,7 +283,7 @@ static int sa1100irq_resume(struct sys_device *dev)
 }
 
 static struct sysdev_class sa1100irq_sysclass = {
-       set_kset_name("sa11x0-irq"),
+       .name           = "sa11x0-irq",
        .suspend        = sa1100irq_suspend,
        .resume         = sa1100irq_resume,
 };
index a9de727c9327aa29eb266e45860a681e72f1d55c..0a5cf3a6438be268f792ae0cb1ec9d7c6a66692c 100644 (file)
@@ -96,7 +96,7 @@ static int op_arm_resume(struct sys_device *dev)
 }
 
 static struct sysdev_class oprofile_sysclass = {
-       set_kset_name("oprofile"),
+       .name           = "oprofile",
        .resume         = op_arm_resume,
        .suspend        = op_arm_suspend,
 };
index 6097753394adaef923105fe47a6b6237fc1a27f7..b2a87b8ef6734e95a3fa207a357bb5c0ecde96bd 100644 (file)
@@ -1455,7 +1455,7 @@ static int omap_gpio_resume(struct sys_device *dev)
 }
 
 static struct sysdev_class omap_gpio_sysclass = {
-       set_kset_name("gpio"),
+       .name           = "gpio",
        .suspend        = omap_gpio_suspend,
        .resume         = omap_gpio_resume,
 };
index 29696e46ed659bab0fdb00cc5fc0f17aaf8f1040..aae1b9cbaf44b77a0e9f4ea7e9f37c04cd1a1191 100644 (file)
@@ -1265,7 +1265,7 @@ static int s3c2410_dma_resume(struct sys_device *dev)
 #endif /* CONFIG_PM */
 
 struct sysdev_class dma_sysclass = {
-       set_kset_name("s3c24xx-dma"),
+       .name           = "s3c24xx-dma",
        .suspend        = s3c2410_dma_suspend,
        .resume         = s3c2410_dma_resume,
 };
index 3444b13afac52ad0a9694785f204f50c71c32ade..f197bb3a2366c980e6cf66d2042b7c19c524f4ee 100644 (file)
@@ -151,13 +151,13 @@ static int s3c244x_resume(struct sys_device *dev)
 /* Since the S3C2442 and S3C2440 share  items, put both sysclasses here */
 
 struct sysdev_class s3c2440_sysclass = {
-       set_kset_name("s3c2440-core"),
+       .name           = "s3c2440-core",
        .suspend        = s3c244x_suspend,
        .resume         = s3c244x_resume
 };
 
 struct sysdev_class s3c2442_sysclass = {
-       set_kset_name("s3c2442-core"),
+       .name           = "s3c2442-core",
        .suspend        = s3c244x_suspend,
        .resume         = s3c244x_resume
 };
index 7014a3571ec024a5cdccc4161817ceb73401013b..36a46c3ae30880c8f2b478f6c9df7c2d84b27247 100644 (file)
@@ -214,7 +214,7 @@ void __init time_init(void)
 }
 
 static struct sysdev_class timer_class = {
-       set_kset_name("timer"),
+       .name = "timer",
 };
 
 static struct sys_device timer_device = {
index 4710135771085dd658cd69e5e9553e609c42acb8..197d7977de356e603465f62e780f945eb3dbe16f 100644 (file)
@@ -238,7 +238,7 @@ static int i8259A_shutdown(struct sys_device *dev)
 }
 
 static struct sysdev_class i8259_sysdev_class = {
-       set_kset_name("i8259"),
+       .name = "i8259",
        .resume = i8259A_resume,
        .shutdown = i8259A_shutdown,
 };
index c83c3e3f51784c55a3ed85f4e67e2e2513cec2f3..a088622036437e8a64c9be58f73e8606c0bb5db5 100644 (file)
@@ -459,7 +459,7 @@ static int spu_shutdown(struct sys_device *sysdev)
 }
 
 static struct sysdev_class spu_sysdev_class = {
-       set_kset_name("spu"),
+       .name = "spu",
        .shutdown = spu_shutdown,
 };
 
index 999f5e160897ba23ba07d7b6ae766d028fa26a7e..84c0d4ef76a2d1c3c88b744a56d0ce2c14cb5c9e 100644 (file)
@@ -663,7 +663,7 @@ static int pmacpic_resume(struct sys_device *sysdev)
 #endif /* CONFIG_PM && CONFIG_PPC32 */
 
 static struct sysdev_class pmacpic_sysclass = {
-       set_kset_name("pmac_pic"),
+       .name = "pmac_pic",
 };
 
 static struct sys_device device_pmacpic = {
index 05a56e55804c3ab4395671b9bd2a4713972cbf20..e898ff4d2b97c9218e2bbb0793e21df86d5b5d28 100644 (file)
@@ -725,7 +725,7 @@ unsigned int ipic_get_irq(void)
 }
 
 static struct sysdev_class ipic_sysclass = {
-       set_kset_name("ipic"),
+       .name = "ipic",
 };
 
 static struct sys_device device_ipic = {
index e47938899a9268c3e926979f7f15e73394810c3d..212a94f5d34b5e6d20ca4169e6014de284a87ebe 100644 (file)
@@ -1584,7 +1584,7 @@ static struct sysdev_class mpic_sysclass = {
        .resume = mpic_resume,
        .suspend = mpic_suspend,
 #endif
-       set_kset_name("mpic"),
+       .name = "mpic",
 };
 
 static int mpic_init_sys(void)
index e1c0fd6dbc1aaf23400cc385d946602de5831d2d..f59444d3be752aa9580d751a9a76c0cd008a5f85 100644 (file)
@@ -483,7 +483,7 @@ int qe_ic_set_high_priority(unsigned int virq, unsigned int priority, int high)
 }
 
 static struct sysdev_class qe_ic_sysclass = {
-       set_kset_name("qe_ic"),
+       .name = "qe_ic",
 };
 
 static struct sys_device device_qe_ic = {
index 9192777d0f78469c9791970327a2b97f4d7d47c8..4f163e20939e2ba94feb6f70a48ad72bed03bdf9 100644 (file)
@@ -614,7 +614,7 @@ int ipic_get_irq(void)
 }
 
 static struct sysdev_class ipic_sysclass = {
-       set_kset_name("ipic"),
+       .name = "ipic",
 };
 
 static struct sys_device device_ipic = {
index 18ec94733293538228d97f311d9e50003f28540a..da36522d327a778fbf4921bbd099a5cefb85af46 100644 (file)
@@ -1043,7 +1043,7 @@ int openpic_resume(struct sys_device *sysdev)
 #endif /* CONFIG_PM */
 
 static struct sysdev_class openpic_sysclass = {
-       set_kset_name("openpic"),
+       .name = "openpic",
 };
 
 static struct sys_device device_openpic = {
index d585207f9f77855e0c8f126dfc52014fbc4328af..449075a0479803f9c17d52fc240f8dbeffcf4478 100644 (file)
@@ -666,7 +666,7 @@ int openpic2_resume(struct sys_device *sysdev)
 
 /* HACK ALERT */
 static struct sysdev_class openpic2_sysclass = {
-       set_kset_name("openpic2"),
+       .name = "openpic2",
 };
 
 static struct sys_device device_openpic2 = {
index 22b800ce2126d0fed3c47400229ef95f4060310b..3bbac1293be45d020ffbb703f74c8c8272ff70ad 100644 (file)
@@ -1145,7 +1145,7 @@ static void etr_work_fn(struct work_struct *work)
  * Sysfs interface functions
  */
 static struct sysdev_class etr_sysclass = {
-       set_kset_name("etr")
+       .name   = "etr",
 };
 
 static struct sys_device etr_port0_dev = {
index eebcd4768bbf01a12ecbfd2cd6b06b0e60f3c5d8..51b57c0d1a3c01f98d99e4bb5071cdb1478b89d3 100644 (file)
@@ -19,7 +19,7 @@
 #include <asm/dma.h>
 
 static struct sysdev_class dma_sysclass = {
-       set_kset_name("dma"),
+       .name = "dma",
 };
 EXPORT_SYMBOL(dma_sysclass);
 
index a3a67d151e520285b08c7fd58cc93d618e079fe6..2bc04bfee73891045e92df6506287aa5ce1e102b 100644 (file)
@@ -174,7 +174,7 @@ int timer_resume(struct sys_device *dev)
 #endif
 
 static struct sysdev_class timer_sysclass = {
-       set_kset_name("timer"),
+       .name    = "timer",
        .suspend = timer_suspend,
        .resume  = timer_resume,
 };
index edb5108e5d0e057f24dabe50ae1fde323b9fed56..a56c782653be7dc17474e133518d75f299659945 100644 (file)
@@ -1530,7 +1530,7 @@ static int lapic_resume(struct sys_device *dev)
  */
 
 static struct sysdev_class lapic_sysclass = {
-       set_kset_name("lapic"),
+       .name           = "lapic",
        .resume         = lapic_resume,
        .suspend        = lapic_suspend,
 };
index f28ccb588fbab8996cd76512d2c1bae24e4b1a2c..fa6cdee6d303a9dbd29b9f198fd2742140ebc0d8 100644 (file)
@@ -639,7 +639,7 @@ static int lapic_resume(struct sys_device *dev)
 }
 
 static struct sysdev_class lapic_sysclass = {
-       set_kset_name("lapic"),
+       .name           = "lapic",
        .resume         = lapic_resume,
        .suspend        = lapic_suspend,
 };
index 4b21d29fb5aa575b6146132db6dadd319ac5ca4a..242e8668dbeb2a6904b9b15feee00f827e099d5f 100644 (file)
@@ -745,7 +745,7 @@ static void mce_restart(void)
 
 static struct sysdev_class mce_sysclass = {
        .resume = mce_resume,
-       set_kset_name("machinecheck"),
+       .name = "machinecheck",
 };
 
 DEFINE_PER_CPU(struct sys_device, device_mce);
index 29313832df0c082409641e1e06f234320d72b254..dbd6c1d1b638bcd739747e54eac08f639d304242 100644 (file)
@@ -51,7 +51,7 @@ static int i8237A_suspend(struct sys_device *dev, pm_message_t state)
 }
 
 static struct sysdev_class i8237_sysdev_class = {
-       set_kset_name("i8237"),
+       .name = "i8237",
        .suspend = i8237A_suspend,
        .resume = i8237A_resume,
 };
index f634fc715c99b455d3973645d4d16c3a80e13361..5f3496d0198403023f652a2e4d0a8a21816887ea 100644 (file)
@@ -258,7 +258,7 @@ static int i8259A_shutdown(struct sys_device *dev)
 }
 
 static struct sysdev_class i8259_sysdev_class = {
-       set_kset_name("i8259"),
+       .name = "i8259",
        .suspend = i8259A_suspend,
        .resume = i8259A_resume,
        .shutdown = i8259A_shutdown,
index 3f27ea0b9816fddb9a98d2587fd5c235b1e123ca..ba6d57286f5648ff299d10e9a2dcb88d0c563ceb 100644 (file)
@@ -370,7 +370,7 @@ static int i8259A_shutdown(struct sys_device *dev)
 }
 
 static struct sysdev_class i8259_sysdev_class = {
-       set_kset_name("i8259"),
+       .name = "i8259",
        .suspend = i8259A_suspend,
        .resume = i8259A_resume,
        .shutdown = i8259A_shutdown,
index a6b1490e00c4abac2953d106691bceec13954930..ab77f1905469592b724ce9c6bdd7c3ea70f0e408 100644 (file)
@@ -2401,7 +2401,7 @@ static int ioapic_resume(struct sys_device *dev)
 }
 
 static struct sysdev_class ioapic_sysdev_class = {
-       set_kset_name("ioapic"),
+       .name = "ioapic",
        .suspend = ioapic_suspend,
        .resume = ioapic_resume,
 };
index cbac1670c7c36ec4ee8c268618b4a8014859c2f3..23a3ac06a23ea1dc68d6d79f6cf7eb3f9f215f96 100644 (file)
@@ -1850,7 +1850,7 @@ static int ioapic_resume(struct sys_device *dev)
 }
 
 static struct sysdev_class ioapic_sysdev_class = {
-       set_kset_name("ioapic"),
+       .name = "ioapic",
        .suspend = ioapic_suspend,
        .resume = ioapic_resume,
 };
index 852db290692186d3f2697e6982a1d77494e708be..4f4bfd3a88b6f89bb6bf080bb1e69787e320f2e7 100644 (file)
@@ -176,7 +176,7 @@ static int lapic_nmi_resume(struct sys_device *dev)
 
 
 static struct sysdev_class nmi_sysclass = {
-       set_kset_name("lapic_nmi"),
+       .name           = "lapic_nmi",
        .resume         = lapic_nmi_resume,
        .suspend        = lapic_nmi_suspend,
 };
index 4253c4e8849cd3abb29c519dc2d4d36d6b6627c3..c3d1476b6a1170673b6ab03a991c320f70af8ec8 100644 (file)
@@ -211,7 +211,7 @@ static int lapic_nmi_resume(struct sys_device *dev)
 }
 
 static struct sysdev_class nmi_sysclass = {
-       set_kset_name("lapic_nmi"),
+       .name           = "lapic_nmi",
        .resume         = lapic_nmi_resume,
        .suspend        = lapic_nmi_suspend,
 };
index 944bbcdd2b8d47035c4202c3331c44d19fdae787..c8ab79ef42761f1df1cfffc2b53a205e5a5282ce 100644 (file)
@@ -51,7 +51,7 @@ static int nmi_resume(struct sys_device *dev)
 
 
 static struct sysdev_class oprofile_sysclass = {
-       set_kset_name("oprofile"),
+       .name           = "oprofile",
        .resume         = nmi_resume,
        .suspend        = nmi_suspend,
 };
index c9f526e55392b1260fb6896772b0ba77ef2ace8a..5400ea173f6fdf0fe309658e2c4de0b13bdbd462 100644 (file)
@@ -911,7 +911,7 @@ __setup("acpi_irq_balance", acpi_irq_balance_set);
 
 /* FIXME: we will remove this interface after all drivers call pci_disable_device */
 static struct sysdev_class irqrouter_sysdev_class = {
-       set_kset_name("irqrouter"),
+       .name = "irqrouter",
        .resume = irqrouter_resume,
 };
 
index 61fd26cc9f0e3093f868d7b3d1b02b9b350cfa72..b962a76875d276349ffc9130734387e52a673126 100644 (file)
@@ -466,7 +466,6 @@ static struct kset_uevent_ops class_uevent_ops = {
  * entirely soon.
  */
 static struct kset class_obj_subsys = {
-       .kobj = { .k_name = "class_obj", },
        .uevent_ops = &class_uevent_ops,
 };
 
@@ -872,6 +871,7 @@ int __init classes_init(void)
        /* ick, this is ugly, the things we go through to keep from showing up
         * in sysfs... */
        kset_init(&class_obj_subsys);
+       kobject_set_name(&class_obj_subsys.kobj, "class_obj");
        if (!class_obj_subsys.kobj.parent)
                class_obj_subsys.kobj.parent = &class_obj_subsys.kobj;
        return 0;
index 40545071e3c93adc625bb51cb87e007333f06417..c5885f5ce0ac9bc44b8bfdb37068360305133ed0 100644 (file)
@@ -14,7 +14,7 @@
 #include "base.h"
 
 struct sysdev_class cpu_sysdev_class = {
-       set_kset_name("cpu"),
+       .name = "cpu",
 };
 EXPORT_SYMBOL(cpu_sysdev_class);
 
index 7868707c7eda30035ea2eff7e3309011c11a2669..7ae413fdd5fc4bd1f0d1b0941316df52dbe8e11f 100644 (file)
@@ -26,7 +26,7 @@
 #define MEMORY_CLASS_NAME      "memory"
 
 static struct sysdev_class memory_sysdev_class = {
-       set_kset_name(MEMORY_CLASS_NAME),
+       .name = MEMORY_CLASS_NAME,
 };
 
 static const char *memory_uevent_name(struct kset *kset, struct kobject *kobj)
index 88eeed72b5d6557289392202a21338496676e55b..e59861f18ce55616981e7ca9fbc5ad2a6698f04f 100644 (file)
@@ -15,7 +15,7 @@
 #include <linux/device.h>
 
 static struct sysdev_class node_class = {
-       set_kset_name("node"),
+       .name = "node",
 };
 
 
index e666441dd76b047ae64d930124054912b047cc40..2f79c55acdcc6af406a9e03b469a4853eefee808 100644 (file)
@@ -136,6 +136,7 @@ int sysdev_class_register(struct sysdev_class * cls)
        cls->kset.kobj.parent = &system_kset->kobj;
        cls->kset.kobj.ktype = &ktype_sysdev_class;
        cls->kset.kobj.kset = system_kset;
+       kobject_set_name(&cls->kset.kobj, cls->name);
        return kset_register(&cls->kset);
 }
 
index e0c4a4086055ad6f2c00bcaabbc77bd91f531d3a..7e1374afd967256054be17b687954151576d60ae 100644 (file)
@@ -31,7 +31,7 @@ struct workqueue_struct *edac_workqueue;
  *     need to export to other files in this modules
  */
 static struct sysdev_class edac_class = {
-       set_kset_name("edac"),
+       .name = "edac",
 };
 static int edac_class_valid;
 
index 47c10b8f89b3f00a16674fec744e334590f523d7..c0f372f1d761312bc648d9deccd8e74609fbc513 100644 (file)
@@ -3451,7 +3451,7 @@ static int kvm_resume(struct sys_device *dev)
 }
 
 static struct sysdev_class kvm_sysdev_class = {
-       set_kset_name("kvm"),
+       .name = "kvm",
        .suspend = kvm_suspend,
        .resume = kvm_resume,
 };
index 6123c70153d3d7db8504cc5eef67ecdc4a14d3a3..ac420b17e16fdbc90c5d3ed2f1c35425c8bcb20f 100644 (file)
@@ -2796,7 +2796,7 @@ static int pmu_sys_resume(struct sys_device *sysdev)
 #endif /* CONFIG_PM_SLEEP && CONFIG_PPC32 */
 
 static struct sysdev_class pmu_sysclass = {
-       set_kset_name("pmu"),
+       .name = "pmu",
 };
 
 static struct sys_device device_pmu = {
index 7663841eb4cfe7af81a3ae186f332ffcf34531e4..a3fdc57e2673a75d877a98b4d882eb723760ad94 100644 (file)
@@ -464,7 +464,7 @@ int sas_eh_bus_reset_handler(struct scsi_cmnd *cmd)
        res = sas_phy_reset(phy, 1);
        if (res)
                SAS_DPRINTK("Bus reset of %s failed 0x%x\n",
-                           phy->dev.kobj.k_name,
+                           kobject_name(&phy->dev.kobj),
                            res);
        if (res == TMF_RESP_FUNC_SUCC || res == TMF_RESP_FUNC_COMPLETE)
                return SUCCESS;
index 504ac0eb441213103a9883ef380c9cd33da7588f..4adbe1d830810cdc77ebe59633f46da2d17c1221 100644 (file)
@@ -61,7 +61,7 @@ enum kobject_action {
 };
 
 struct kobject {
-       const char              * k_name;
+       const char              *name;
        struct kref             kref;
        struct list_head        entry;
        struct kobject          * parent;
@@ -69,7 +69,6 @@ struct kobject {
        struct kobj_type        * ktype;
        struct sysfs_dirent     * sd;
        unsigned int state_initialized:1;
-       unsigned int state_name_set:1;
        unsigned int state_in_sysfs:1;
        unsigned int state_add_uevent_sent:1;
        unsigned int state_remove_uevent_sent:1;
@@ -80,7 +79,7 @@ extern int kobject_set_name(struct kobject *, const char *, ...)
 
 static inline const char * kobject_name(const struct kobject * kobj)
 {
-       return kobj->k_name;
+       return kobj->name;
 }
 
 extern void kobject_init(struct kobject *kobj, struct kobj_type *ktype);
@@ -189,14 +188,6 @@ static inline struct kobj_type *get_ktype(struct kobject *kobj)
 
 extern struct kobject * kset_find_obj(struct kset *, const char *);
 
-
-/*
- * Use this when initializing an embedded kset with no other 
- * fields to initialize.
- */
-#define set_kset_name(str)     .kset = { .kobj = { .k_name = str } }
-
-
 /* The global /sys/kernel/ kobject for people to chain off of */
 extern struct kobject *kernel_kobj;
 /* The global /sys/hypervisor/ kobject for people to chain off of */
index e285746588d68baf4dccc894e70768005342e04a..f752e73bf977e98381b95070096522c84e2ed5a1 100644 (file)
@@ -29,6 +29,7 @@
 struct sys_device;
 
 struct sysdev_class {
+       const char *name;
        struct list_head        drivers;
 
        /* Default operations for these types of devices */
index e3055ba6915978c4290492ef16cacb3f3a844c61..092e4c620af908410a30ef3ee9ece43df72dcb84 100644 (file)
@@ -394,7 +394,7 @@ static SYSDEV_ATTR(status, 0600, sysfs_test_status, NULL);
 static SYSDEV_ATTR(command, 0600, NULL, sysfs_test_command);
 
 static struct sysdev_class rttest_sysclass = {
-       set_kset_name("rttest"),
+       .name = "rttest",
 };
 
 static int init_test_thread(int id)
index c8a9d13874dfdcf85c6b2ab9d7d03f92a8f39401..8d6125ad2cf0cf3c76368e582d9750066d176232 100644 (file)
@@ -441,7 +441,7 @@ static SYSDEV_ATTR(available_clocksource, 0600,
                   sysfs_show_available_clocksources, NULL);
 
 static struct sysdev_class clocksource_sysclass = {
-       set_kset_name("clocksource"),
+       .name = "clocksource",
 };
 
 static struct sys_device device_clocksource = {
index e5e466b2759893ccd21cea1e2242b8fbf7dac9a5..ab46ae8c062b0b971aaae2fc28071d0cc01260ed 100644 (file)
@@ -335,9 +335,9 @@ static int timekeeping_suspend(struct sys_device *dev, pm_message_t state)
 
 /* sysfs resume/suspend bits for timekeeping */
 static struct sysdev_class timekeeping_sysclass = {
+       .name           = "timekeeping",
        .resume         = timekeeping_resume,
        .suspend        = timekeeping_suspend,
-       set_kset_name("timekeeping"),
 };
 
 static struct sys_device device_timer = {
index a0773734545c913bf2b9a59472b66b53021117a5..8dc32454661d50c08c330b355d28d1c2acc8927d 100644 (file)
@@ -165,7 +165,7 @@ static int kobject_add_internal(struct kobject *kobj)
        if (!kobj)
                return -ENOENT;
 
-       if (!kobj->k_name || !kobj->k_name[0]) {
+       if (!kobj->name || !kobj->name[0]) {
                pr_debug("kobject: (%p): attempted to be registered with empty "
                         "name!\n", kobj);
                WARN_ON(1);
@@ -228,13 +228,11 @@ static int kobject_set_name_vargs(struct kobject *kobj, const char *fmt,
        if (!name)
                return -ENOMEM;
 
-
        /* Free the old name, if necessary. */
-       kfree(kobj->k_name);
+       kfree(kobj->name);
 
        /* Now, set the new name */
-       kobj->k_name = name;
-       kobj->state_name_set = 1;
+       kobj->name = name;
 
        return 0;
 }
@@ -295,7 +293,6 @@ void kobject_init(struct kobject *kobj, struct kobj_type *ktype)
        kref_init(&kobj->kref);
        INIT_LIST_HEAD(&kobj->entry);
        kobj->ktype = ktype;
-       kobj->state_name_set = 0;
        kobj->state_in_sysfs = 0;
        kobj->state_add_uevent_sent = 0;
        kobj->state_remove_uevent_sent = 0;
@@ -551,8 +548,7 @@ struct kobject * kobject_get(struct kobject * kobj)
 static void kobject_cleanup(struct kobject *kobj)
 {
        struct kobj_type *t = get_ktype(kobj);
-       const char *name = kobj->k_name;
-       int name_set = kobj->state_name_set;
+       const char *name = kobj->name;
 
        pr_debug("kobject: '%s' (%p): %s\n",
                 kobject_name(kobj), kobj, __FUNCTION__);
@@ -583,7 +579,7 @@ static void kobject_cleanup(struct kobject *kobj)
        }
 
        /* free name if we allocated it */
-       if (name_set && name) {
+       if (name) {
                pr_debug("kobject: '%s': free name\n", name);
                kfree(name);
        }