Lines Matching full:foo
45 //! struct Foo {
50 //! impl Foo {
52 //! pr_info!("Setting up foo\n");
56 //! let foo = pin_init!(Foo {
63 //! }).pin_chain(|foo| {
64 //! foo.setup();
75 //! # pub struct foo;
76 //! # pub unsafe fn init_foo(_ptr: *mut foo) {}
77 //! # pub unsafe fn destroy_foo(_ptr: *mut foo) {}
78 //! # pub unsafe fn enable_foo(_ptr: *mut foo, _flags: u32) -> i32 { 0 }
90 //! /// `foo` is always initialized
94 //! foo: Opaque<bindings::foo>,
103 //! // enabled `foo`,
108 //! let foo = addr_of_mut!((*slot).foo);
110 //! // Initialize the `foo`
111 //! bindings::init_foo(Opaque::raw_get(foo));
114 //! let err = bindings::enable_foo(Opaque::raw_get(foo), flags);
116 //! // Enabling has failed, first clean up the foo and then return the error.
117 //! bindings::destroy_foo(Opaque::raw_get(foo));
131 //! // SAFETY: Since `foo` is initialized, destroying is safe.
132 //! unsafe { bindings::destroy_foo(self.foo.get()) };