Skip to content

Commit ba47c46

Browse files
Danilo KrummrichDarksonn
authored andcommitted
drm/tyr: separate driver type from driver data
Introduce TyrPlatformDriver as a unit struct for the platform::Driver trait implementation and keep TyrPlatformDriverData for the private driver data. Reviewed-by: Gary Guo <gary@garyguo.net> Tested-by: Deborah Brouwer <deborah.brouwer@collabora.com> Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com> Reviewed-by: Eliot Courtney <ecourtney@nvidia.com> Signed-off-by: Danilo Krummrich <dakr@kernel.org> Reviewed-by: Alexandre Courbot <acourbot@nvidia.com> Link: https://patch.msgid.link/20260529000106.2257996-2-dakr@kernel.org Signed-off-by: Alice Ryhl <aliceryhl@google.com>
1 parent 75d5932 commit ba47c46

2 files changed

Lines changed: 8 additions & 6 deletions

File tree

drivers/gpu/drm/tyr/driver.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ pub(crate) struct TyrDrmDriver;
5151
/// Convenience type alias for the DRM device type for this driver.
5252
pub(crate) type TyrDrmDevice = drm::Device<TyrDrmDriver>;
5353

54+
pub(crate) struct TyrPlatformDriver;
55+
5456
#[pin_data(PinnedDrop)]
5557
pub(crate) struct TyrPlatformDriverData {
5658
_device: ARef<TyrDrmDevice>,
@@ -93,22 +95,22 @@ fn issue_soft_reset(dev: &Device<Bound>, iomem: &Devres<IoMem>) -> Result {
9395
kernel::of_device_table!(
9496
OF_TABLE,
9597
MODULE_OF_TABLE,
96-
<TyrPlatformDriverData as platform::Driver>::IdInfo,
98+
<TyrPlatformDriver as platform::Driver>::IdInfo,
9799
[
98100
(of::DeviceId::new(c"rockchip,rk3588-mali"), ()),
99101
(of::DeviceId::new(c"arm,mali-valhall-csf"), ())
100102
]
101103
);
102104

103-
impl platform::Driver for TyrPlatformDriverData {
105+
impl platform::Driver for TyrPlatformDriver {
104106
type IdInfo = ();
105-
type Data<'bound> = Self;
107+
type Data<'bound> = TyrPlatformDriverData;
106108
const OF_ID_TABLE: Option<of::IdTable<Self::IdInfo>> = Some(&OF_TABLE);
107109

108110
fn probe<'bound>(
109111
pdev: &'bound platform::Device<Core<'_>>,
110112
_info: Option<&'bound Self::IdInfo>,
111-
) -> impl PinInit<Self, Error> + 'bound {
113+
) -> impl PinInit<Self::Data<'bound>, Error> + 'bound {
112114
let core_clk = Clk::get(pdev.as_ref(), Some(c"core"))?;
113115
let stacks_clk = OptionalClk::get(pdev.as_ref(), Some(c"stacks"))?;
114116
let coregroup_clk = OptionalClk::get(pdev.as_ref(), Some(c"coregroup"))?;

drivers/gpu/drm/tyr/tyr.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
//! The name "Tyr" is inspired by Norse mythology, reflecting Arm's tradition of
66
//! naming their GPUs after Nordic mythological figures and places.
77
8-
use crate::driver::TyrPlatformDriverData;
8+
use crate::driver::TyrPlatformDriver;
99

1010
mod driver;
1111
mod file;
@@ -14,7 +14,7 @@ mod gpu;
1414
mod regs;
1515

1616
kernel::module_platform_driver! {
17-
type: TyrPlatformDriverData,
17+
type: TyrPlatformDriver,
1818
name: "tyr",
1919
authors: ["The Tyr driver authors"],
2020
description: "Arm Mali Tyr DRM driver",

0 commit comments

Comments
 (0)