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

David Collins quic_collinsd at quicinc.com
Fri Apr 5 18:29:07 PDT 2024


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




More information about the Linux-mediatek mailing list