From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4C1303385B6 for ; Fri, 24 Apr 2026 16:03:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777046632; cv=none; b=DO18kLNpxI0UEYteNodh+22q30Akb7e1lXg1EoE0PCHU/tKEhwzJDjqmg5fiE6QiuNYaveYwZzWvEYff6/f2LjNVU1tKi6AOBMRBWoH0UKHpbsJuobFBZivEAq0JwxXsi80mIsHZWXNASM2i5/rMXZMwK2kAdcP49iwS86JVB/4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777046632; c=relaxed/simple; bh=OpjYnvUINC0m/fERNUlL4a3+lpA8IFC0Re5p9y/suRY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=gP49oA7XgwYmIxehzBlbF2KSDjlolqDN5UWsOhzOWV7tuDyO5bZymuBDK0veEV+yx5d64cofyY27tVYEOZlq8nKRHB0+PJ7SfYW77nPmwamzSiqOxHnfiAsxVmJg7HzNPwESSSDWRl3XHhs0Qx7Ppybxhy30qrj/q2EHdriFu28= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=kHPx5zDe; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="kHPx5zDe" Received: by smtp.kernel.org (Postfix) with ESMTPSA id EAF7CC19425; Fri, 24 Apr 2026 16:03:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1777046632; bh=OpjYnvUINC0m/fERNUlL4a3+lpA8IFC0Re5p9y/suRY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kHPx5zDeAWeJIGcgZA6QqcJE9toft/blPMdaDaFKnu4DQf+K7B8fuF1ef4m2JhmKb 9t2l4/TtcsBjz+6bsUaSGseDixTCFT3GOqugf+F7o9a7Oy7EWNkJQ2eSuy5v/eHeco a0Xm4Dfzos6CG+I9ttnvmRpAluFfu+zIxB9kA8hvrn6WRlHMB+Y8risu8KQMznvdfj obiDYVOKkAbBlUJjhpqk+qbGwF50onmRd1MvmeOdj+7fKoG7OG0PL8F28aIcOOCG2x WC6NeRazMriMZ7eREcgtG+C/AMlxpbGbstDeaV8oXVU1nSvZD2pZeN67z65FrHXayE kts7z/a9NB3iQ== Received: from johan by xi.lan with local (Exim 4.98.2) (envelope-from ) id 1wGJ0P-0000000BDJd-3H6m; Fri, 24 Apr 2026 18:03:49 +0200 From: Johan Hovold To: Geoff Levand , Madhavan Srinivasan , Michael Ellerman Cc: Nicholas Piggin , Christophe Leroy , Greg Kroah-Hartman , linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, Johan Hovold Subject: [PATCH v2 1/3] powerpc/ps3: switch to dynamic system bus root device Date: Fri, 24 Apr 2026 18:02:57 +0200 Message-ID: <20260424160259.2672722-2-johan@kernel.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260424160259.2672722-1-johan@kernel.org> References: <20260424160259.2672722-1-johan@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Driver core expects devices to be dynamically allocated and will, for example, complain loudly if a device that lacks a release function is ever freed. Use root_device_register() to allocate and register the root device instead of open coding using a static device. Signed-off-by: Johan Hovold --- arch/powerpc/platforms/ps3/system-bus.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/arch/powerpc/platforms/ps3/system-bus.c b/arch/powerpc/platforms/ps3/system-bus.c index 0537a678a32f..4ead6ccea259 100644 --- a/arch/powerpc/platforms/ps3/system-bus.c +++ b/arch/powerpc/platforms/ps3/system-bus.c @@ -20,9 +20,7 @@ #include "platform.h" -static struct device ps3_system_bus = { - .init_name = "ps3_system", -}; +static struct device *ps3_system_bus; /* FIXME: need device usage counters! */ static struct { @@ -486,8 +484,8 @@ static int __init ps3_system_bus_init(void) mutex_init(&usage_hack.mutex); - result = device_register(&ps3_system_bus); - BUG_ON(result); + ps3_system_bus = root_device_register("ps3_system"); + BUG_ON(IS_ERR(ps3_system_bus)); result = bus_register(&ps3_system_bus_type); BUG_ON(result); @@ -744,7 +742,7 @@ int ps3_system_bus_device_register(struct ps3_system_bus_device *dev) static unsigned int dev_lpm_count; if (!dev->core.parent) - dev->core.parent = &ps3_system_bus; + dev->core.parent = ps3_system_bus; dev->core.bus = &ps3_system_bus_type; dev->core.release = ps3_system_bus_release_device; -- 2.53.0