Lines Matching full:safety

46 // SAFETY:
57 // SAFETY: A call to `unregister` for a given instance of `DriverType` is guaranteed to be valid if
75 // SAFETY: It's safe to set the fields of `struct platform_driver` on initialization. in register()
84 // SAFETY: `pdrv` is guaranteed to be a valid `DriverType`. in register()
91 // SAFETY: `pdrv` is guaranteed to be a valid `DriverType`. in unregister()
98 // SAFETY: The platform bus only ever calls the probe callback with a valid pointer to a in probe_callback()
103 // SAFETY: `pdev` matched data is of type `Self::IdInfo`. in probe_callback()
115 // SAFETY: The platform bus only ever calls the remove callback with a valid pointer to a in remove_callback()
121 // SAFETY: `remove_callback` is only ever called after a successful call to in remove_callback()
273 // SAFETY: `self.as_raw()` returns a valid pointer to a `struct platform_device`. in resource_by_index()
282 // SAFETY: `resource` is a valid pointer to a `struct resource` as in resource_by_index()
289 // SAFETY: `self.as_raw()` returns a valid pointer to a `struct in resource_by_name()
303 // SAFETY: `resource` is a valid pointer to a `struct resource` as in resource_by_name()
314 // SAFETY: `resource` is a valid resource for `&self` during the in io_request_by_index()
322 // SAFETY: `resource` is a valid resource for `&self` during the in io_request_by_name()
328 // SAFETY: `platform::Device` is a transparent wrapper of `struct platform_device`.
343 /// # Safety
357 // SAFETY: Caller guarantees the Registration will not be leaked.
380 /// # Safety
394 // SAFETY: Caller guarantees the Registration will not be leaked.
411 // SAFETY: `self.as_raw` returns a valid pointer to a `struct platform_device`. in irq_by_index()
418 // SAFETY: `irq` is guaranteed to be a valid IRQ number for `&self`. in irq_by_index()
425 // SAFETY: `self.as_raw` returns a valid pointer to a `struct platform_device`. in optional_irq_by_index()
432 // SAFETY: `irq` is guaranteed to be a valid IRQ number for `&self`. in optional_irq_by_index()
438 // SAFETY: `self.as_raw` returns a valid pointer to a `struct platform_device`. in irq_by_name()
445 // SAFETY: `irq` is guaranteed to be a valid IRQ number for `&self`. in irq_by_name()
452 // SAFETY: `self.as_raw` returns a valid pointer to a `struct platform_device`. in optional_irq_by_name()
461 // SAFETY: `irq` is guaranteed to be a valid IRQ number for `&self`. in optional_irq_by_name()
529 // SAFETY: `Device` is a transparent wrapper of a type that doesn't depend on `Device`'s generic
536 // SAFETY: Instances of `Device` are always reference-counted.
539 // SAFETY: The existence of a shared reference guarantees that the refcount is non-zero. in inc_ref()
544 // SAFETY: The safety requirements guarantee that the refcount is non-zero. in dec_ref()
551 // SAFETY: By the type invariant of `Self`, `self.as_raw()` is a pointer to a valid in as_ref()
555 // SAFETY: `dev` points to a valid `struct device`. in as_ref()
564 // SAFETY: By the type invariant of `Device`, `dev.as_raw()` is a valid pointer to a in try_from()
570 // SAFETY: We've just verified that the bus type of `dev` equals in try_from()
575 // SAFETY: `pdev` is a valid pointer to a `struct platform_device`. in try_from()
580 // SAFETY: A `Device` is always reference-counted and can be released from any thread.
583 // SAFETY: `Device` can be shared among threads because all methods of `Device`
587 // SAFETY: Same as `Device<Normal>` -- the underlying `struct platform_device` is the same;
588 // `Bound` is a zero-sized type-state marker that does not affect thread safety.