diff --git a/drivers/gpu/drm/tyr/driver.rs b/drivers/gpu/drm/tyr/driver.rs index e8acd2d69468..bb56a9b996a0 100644 --- a/drivers/gpu/drm/tyr/driver.rs +++ b/drivers/gpu/drm/tyr/driver.rs @@ -52,7 +52,7 @@ pub(crate) struct TyrPlatformDriverData { _device: ARef, } -#[pin_data(PinnedDrop)] +#[pin_data] pub(crate) struct TyrDrmDeviceData { pub(crate) pdev: ARef, @@ -157,17 +157,6 @@ impl PinnedDrop for TyrPlatformDriverData { fn drop(self: Pin<&mut Self>) {} } -#[pinned_drop] -impl PinnedDrop for TyrDrmDeviceData { - fn drop(self: Pin<&mut Self>) { - // TODO: the type-state pattern for Clks will fix this. - let clks = self.clks.lock(); - clks.core.disable_unprepare(); - clks.stacks.disable_unprepare(); - clks.coregroup.disable_unprepare(); - } -} - // We need to retain the name "panthor" to achieve drop-in compatibility with // the C driver in the userspace stack. const INFO: drm::DriverInfo = drm::DriverInfo { @@ -191,14 +180,20 @@ impl drm::Driver for TyrDrmDriver { } } -#[pin_data] struct Clocks { core: Clk, stacks: OptionalClk, coregroup: OptionalClk, } -#[pin_data] +impl Drop for Clocks { + fn drop(&mut self) { + self.core.disable_unprepare(); + self.stacks.disable_unprepare(); + self.coregroup.disable_unprepare(); + } +} + struct Regulators { _mali: Regulator, _sram: Regulator,