Re: [PATCH v2] spmi: Fix controller->node != parent->node breakage

From: AngeloGioacchino Del Regno
Date: Mon Jan 13 2025 - 08:52:20 EST


Il 13/01/25 14:02, Konrad Dybcio ha scritto:
From: Konrad Dybcio <konrad.dybcio@xxxxxxxxxxxxxxxx>

On some platforms, like recent Qualcomm SoCs with multi-bus SPMI
arbiters, controller->node must be assigned to the individual buses'
subnodes, as the slave devices are children of these, like so:

arbiter@c400000
spmi@c42d000
pmic@0

spmi@c432000
pmic@0

The commit referenced in Fixes changed that assignment, such that
spmi_controller_alloc() always assumes the PMICs come directly under
the arbiter node (which is true when there's only a single bus per
controller).

Make controller->node specifiable to both benefit from Joe's refcount
improvements and un-break the aforementioned platforms.

Fixes: 821b07853e32 ("spmi: hisi-spmi-controller: manage the OF node reference in device initialization and cleanup")
Signed-off-by: Konrad Dybcio <konrad.dybcio@xxxxxxxxxxxxxxxx>

for spmi.c/.h, spmi-devres and for MediaTek:

Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@xxxxxxxxxxxxx>

Cheers!