Re: [PATCH v8 7/7] spmi: pmic-arb: Add multi bus support

From: David Collins
Date: Fri Apr 05 2024 - 21:29:52 EST


On 4/2/24 05:07, Abel Vesa wrote:
> +static void spmi_pmic_arb_deregister_buses(struct spmi_pmic_arb *pmic_arb)
> +{
> + int i;
> +
> + for (i = 0; i < PMIC_ARB_MAX_BUSES; i++) {

s/PMIC_ARB_MAX_BUSES/pmic_arb->buses_available/

This is needed to avoid a NULL pointer dereference in the case that a
single SPMI bus is specified in DT and then removed at runtime.

> + struct spmi_pmic_arb_bus *bus = pmic_arb->buses[i];
> +
> + irq_set_chained_handler_and_data(bus->irq,
> + NULL, NULL);
> + irq_domain_remove(bus->domain);
> + }
> +}

Thanks,
David Collins