Skip to content

Commit b4ef314

Browse files
authored
Merge pull request #740 from wedsonaf/use-raw-spinlock
gpio: pl061: use raw spinlock
2 parents 9237598 + cb54d39 commit b4ef314

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

drivers/gpio/gpio_pl061_rust.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ use kernel::{
1010
irq::{self, ExtraResult, IrqData, LockedIrqData},
1111
power,
1212
prelude::*,
13-
sync::{Ref, RefBorrow, SpinLock},
13+
sync::{RawSpinLock, Ref, RefBorrow},
1414
};
1515

1616
const GPIODIR: usize = 0x400;
@@ -41,7 +41,7 @@ struct PL061DataInner {
4141

4242
struct PL061Data {
4343
dev: device::Device,
44-
inner: SpinLock<PL061DataInner>,
44+
inner: RawSpinLock<PL061DataInner>,
4545
}
4646

4747
struct PL061Resources {
@@ -283,15 +283,15 @@ impl amba::Driver for PL061Device {
283283
},
284284
PL061Data {
285285
dev: device::Device::from_dev(dev),
286-
// SAFETY: We call `spinlock_init` below.
287-
inner: unsafe { SpinLock::new(PL061DataInner::default()) },
286+
// SAFETY: We call `rawspinlock_init` below.
287+
inner: unsafe { RawSpinLock::new(PL061DataInner::default()) },
288288
},
289289
"PL061::Registrations"
290290
)?;
291291

292292
// SAFETY: General part of the data is pinned when `data` is.
293293
let gen_inner = unsafe { data.as_mut().map_unchecked_mut(|d| &mut (**d).inner) };
294-
kernel::spinlock_init!(gen_inner, "PL061Data::inner");
294+
kernel::rawspinlock_init!(gen_inner, "PL061Data::inner");
295295

296296
let data = Ref::<DeviceData>::from(data);
297297

0 commit comments

Comments
 (0)