From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-181.mta1.migadu.com (out-181.mta1.migadu.com [95.215.58.181]) (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 362A7394797 for ; Thu, 21 May 2026 07:58:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.181 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779350294; cv=none; b=D9rpowvrtgjl3o4CbpurUmuLNR7uakNmKdeIP7le4Agi3dP6ZuH6AGiwnP/cqoVkxlobnJO/bHxthvXBkG6tNhrwHcvAUybLaWywelmMobODuKeubTR1o9Bfo/vRmLHmiXcM2fq9SsBQKDY680h0Y0zYSYsLAEtNdPnMkiYuyrY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779350294; c=relaxed/simple; bh=fdIHTlNJ5S9w5BaBBxNHieY+5HrJDP909szi2mPAjps=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=BXgyfTN34yJJM9batUwN9WdTnCRWkFmB9a8Ka+HhdK9JlAUdlDQc527ENdTxRZ2unXAOuWawCUb8yZaqUfMtOODliDE8ZLBH4UtqkmUKBzv3BkNw/GQwe0+Uog9mqtAh0ONti7bwEtWtQcQKDPgZ0THuNKz4p2ufuHn/KwVJjrU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=Iv/kUm6n; arc=none smtp.client-ip=95.215.58.181 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="Iv/kUm6n" Message-ID: <81013175-0164-4ad4-a4a7-0cab332b695b@linux.dev> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1779350290; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=qvW89Y5yfvW9tGdg4/aM0qB0CsEzidAsVDHwaWcD2rs=; b=Iv/kUm6ntc1nclOZY3Cbub6Jza3tf2c1fxkkBVni4Osz/a52CsxDJaJwW3ZWCAXFi0XiRh 0uRE7AOVta6oDrhghHpMBu0X351qPMkPHyEeAmHnU5+L1mG27GB0tm/2457Gm6qhe8lkBC lA+diiK0q90tc/UJ9UIRzA1ECGTa0g8= Date: Thu, 21 May 2026 15:57:31 +0800 Precedence: bulk X-Mailing-List: nova-gpu@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Subject: Re: [PATCH 2/8] rust: driver: make `DriverModule` struct pub(crate) in `module_driver!` To: Gary Guo , Miguel Ojeda , Boqun Feng , =?UTF-8?Q?Bj=C3=B6rn_Roy_Baron?= , Benno Lossin , Andreas Hindborg , Alice Ryhl , Trevor Gross , Danilo Krummrich , Luis Chamberlain , Petr Pavlu , Daniel Gomez , Sami Tolvanen , Aaron Tomlin , Greg Kroah-Hartman , "Rafael J. Wysocki" , David Airlie , Simona Vetter , Daniel Almeida , Arnd Bergmann Cc: rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org, linux-modules@vger.kernel.org, driver-core@lists.linux.dev, dri-devel@lists.freedesktop.org, nova-gpu@lists.linux.dev References: <20260519-fix-fops-owner-v1-0-2ded9830da14@linux.dev> <20260519-fix-fops-owner-v1-2-2ded9830da14@linux.dev> X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Alvin Sun In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT On 5/19/26 19:53, Gary Guo wrote: > On Tue May 19, 2026 at 7:26 AM BST, Alvin Sun wrote: >> Expose the generated `DriverModule` struct as `pub(crate)` so that >> driver implementations can reference it via `super::DriverModule` >> for the `ThisModule` associated type. > Why is this needed? Child modules can see items super modules. I misread it — I've already used LocalModule directly in v2. Best regards, Alvin > > Best, > Gary > >> Signed-off-by: Alvin Sun >> --- >> rust/kernel/driver.rs | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/rust/kernel/driver.rs b/rust/kernel/driver.rs >> index 36de8098754d0..9c7c69c4d2af0 100644 >> --- a/rust/kernel/driver.rs >> +++ b/rust/kernel/driver.rs >> @@ -253,7 +253,7 @@ macro_rules! module_driver { >> type Ops<$gen_type> = $driver_ops; >> >> #[$crate::prelude::pin_data] >> - struct DriverModule { >> + pub(crate) struct DriverModule { >> #[pin] >> _driver: $crate::driver::Registration>, >> }