diff options
| author | AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> | 2026-07-21 11:36:20 +0200 |
|---|---|---|
| committer | Stephen Boyd <sboyd@kernel.org> | 2026-10-14 20:03:57 -0700 |
| commit | 939e80cef9a757ca3a08cd1c8665726837405c0f (patch) | |
| tree | 58067e07a6c2892245f9b194de876f2e594a69c8 /tools/lib/python | |
| parent | 6e19e5d699f37e01f4e6c7b25f17cd603195d27c (diff) | |
spmi: Add helper to get a parent SPMI device
Drivers that register a SPMI sub-device as a platform_driver are
not guaranteed to have a SPMI device as their parent: add a new
helper `spmi_get_parent_spmi_device()` that takes a struct device
and checks if there's a parent, and if that parent is actually a
SPMI device by checking if its device type matches with SPMI: if
so, returns a pointer to the relative struct spmi_device without
incrementing any refcount.
As a note, in the specific case of using this helper to retrieve
a SPMI subdevice's parent, the spmi_subdevice_alloc_and_add()
function does actually call device_add(), which will already take
care of raising the refcount of the associated parent device.
Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Reviewed-by: Abel Vesa <abel.vesa@oss.qualcomm.com>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
Diffstat (limited to 'tools/lib/python')
0 files changed, 0 insertions, 0 deletions
