Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1761118AbYAYIj2 (ORCPT ); Fri, 25 Jan 2008 03:39:28 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1760771AbYAYIBs (ORCPT ); Fri, 25 Jan 2008 03:01:48 -0500 Received: from cantor.suse.de ([195.135.220.2]:59442 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758468AbYAYH7s (ORCPT ); Fri, 25 Jan 2008 02:59:48 -0500 From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , Kay Sievers Subject: [PATCH 121/196] Kobject: change arch/sh/kernel/cpu/sh4/sq.c to use kobject_init_and_add Date: Thu, 24 Jan 2008 23:32:30 -0800 Message-Id: <1201246425-5058-42-git-send-email-gregkh@suse.de> X-Mailer: git-send-email 1.5.3.8 In-Reply-To: <20080125071127.GA4860@kroah.com> References: <20080125071127.GA4860@kroah.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1434 Lines: 45 Stop using kobject_register, as this way we can control the sending of the uevent properly, after everything is properly initialized. Cc: Kay Sievers Signed-off-by: Greg Kroah-Hartman --- arch/sh/kernel/cpu/sh4/sq.c | 11 ++++++----- 1 files changed, 6 insertions(+), 5 deletions(-) diff --git a/arch/sh/kernel/cpu/sh4/sq.c b/arch/sh/kernel/cpu/sh4/sq.c index b22a78c..97fd9b9 100644 --- a/arch/sh/kernel/cpu/sh4/sq.c +++ b/arch/sh/kernel/cpu/sh4/sq.c @@ -341,17 +341,18 @@ static int __devinit sq_sysdev_add(struct sys_device *sysdev) { unsigned int cpu = sysdev->id; struct kobject *kobj; + int error; sq_kobject[cpu] = kzalloc(sizeof(struct kobject), GFP_KERNEL); if (unlikely(!sq_kobject[cpu])) return -ENOMEM; kobj = sq_kobject[cpu]; - kobj->parent = &sysdev->kobj; - kobject_set_name(kobj, "%s", "sq"); - kobj->ktype = &ktype_percpu_entry; - - return kobject_register(kobj); + error = kobject_init_and_add(kobj, &ktype_percpu_entry, &sysdev->kobj, + "%s", "sq"); + if (!error) + kobject_uevent(kobj, KOBJ_ADD); + return error; } static int __devexit sq_sysdev_remove(struct sys_device *sysdev) -- 1.5.3.8 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/