Skip to content

Commit 5ec66bb

Browse files
deborahbrouwerDarksonn
authored andcommitted
drm/tyr: suppress unread field warnings
Currently the rust compiler warns that certain fields in the TyrDriver are 'never read'. The fields are needed, but they are not read directly, they are only written into an 'impl PinInit' that is returned by probe. When warnings are compiled as errors, these warnings prevent Tyr from building. Suppress the warnings by adding underscores to the problematic variables. This allows Tyr to build again. Signed-off-by: Deborah Brouwer <deborah.brouwer@collabora.com> Link: https://patch.msgid.link/20260123175235.209092-1-deborah.brouwer@collabora.com Signed-off-by: Alice Ryhl <aliceryhl@google.com>
1 parent 638eeda commit 5ec66bb

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

drivers/gpu/drm/tyr/driver.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ pub(crate) type TyrDevice = drm::Device<TyrDriver>;
3434

3535
#[pin_data(PinnedDrop)]
3636
pub(crate) struct TyrDriver {
37-
device: ARef<TyrDevice>,
37+
_device: ARef<TyrDevice>,
3838
}
3939

4040
#[pin_data(PinnedDrop)]
@@ -127,16 +127,16 @@ impl platform::Driver for TyrDriver {
127127
coregroup: coregroup_clk,
128128
}),
129129
regulators <- new_mutex!(Regulators {
130-
mali: mali_regulator,
131-
sram: sram_regulator,
130+
_mali: mali_regulator,
131+
_sram: sram_regulator,
132132
}),
133133
gpu_info,
134134
});
135135

136136
let tdev: ARef<TyrDevice> = drm::Device::new(pdev.as_ref(), data)?;
137137
drm::driver::Registration::new_foreign_owned(&tdev, pdev.as_ref(), 0)?;
138138

139-
let driver = TyrDriver { device: tdev };
139+
let driver = TyrDriver { _device: tdev };
140140

141141
// We need this to be dev_info!() because dev_dbg!() does not work at
142142
// all in Rust for now, and we need to see whether probe succeeded.
@@ -193,6 +193,6 @@ struct Clocks {
193193

194194
#[pin_data]
195195
struct Regulators {
196-
mali: Regulator<regulator::Enabled>,
197-
sram: Regulator<regulator::Enabled>,
196+
_mali: Regulator<regulator::Enabled>,
197+
_sram: Regulator<regulator::Enabled>,
198198
}

0 commit comments

Comments
 (0)