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();
74 //! # pub struct foo;
75 //! # pub unsafe fn init_foo(_ptr: *mut foo) {}
76 //! # pub unsafe fn destroy_foo(_ptr: *mut foo) {}
77 //! # pub unsafe fn enable_foo(_ptr: *mut foo, _flags: u32) -> i32 { 0 }
81 //! /// `foo` is always initialized
85 //! foo: Opaque<bindings::foo>,
94 //! // enabled `foo`,
99 //! let foo = addr_of_mut!((*slot).foo);
101 //! // Initialize the `foo`
102 //! bindings::init_foo(Opaque::cast_into(foo));
105 //! let err = bindings::enable_foo(Opaque::cast_into(foo), flags);
107 //! // Enabling has failed, first clean up the foo and then return the error.
108 //! bindings::destroy_foo(Opaque::cast_into(foo));
122 //! // SAFETY: Since `foo` is initialized, destroying is safe.
123 //! unsafe { bindings::destroy_foo(self.foo.get()) };