[PATCH 06/17] i3c: mipi-i3c-hci: Switch PIO data allocation to devm_kzalloc()

Frank Li Frank.li at nxp.com
Fri Dec 19 08:28:47 PST 2025


On Fri, Dec 19, 2025 at 04:45:23PM +0200, Adrian Hunter wrote:
> The driver already uses managed resources, so convert the PIO data
> structure allocation to use devm_zalloc().  Remove the manual kfree().

Nit: remove word 'use'.

Reviewed-by: Frank Li <Frank.Li at nxp.com>
>
> Signed-off-by: Adrian Hunter <adrian.hunter at intel.com>
> ---
>  drivers/i3c/master/mipi-i3c-hci/pio.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/drivers/i3c/master/mipi-i3c-hci/pio.c b/drivers/i3c/master/mipi-i3c-hci/pio.c
> index 90dca56fc0c5..3d633abf6099 100644
> --- a/drivers/i3c/master/mipi-i3c-hci/pio.c
> +++ b/drivers/i3c/master/mipi-i3c-hci/pio.c
> @@ -140,7 +140,7 @@ static int hci_pio_init(struct i3c_hci *hci)
>  	struct hci_pio_data *pio;
>  	u32 val, size_val, rx_thresh, tx_thresh, ibi_val;
>
> -	pio = kzalloc(sizeof(*pio), GFP_KERNEL);
> +	pio = devm_kzalloc(hci->master.dev.parent, sizeof(*pio), GFP_KERNEL);
>  	if (!pio)
>  		return -ENOMEM;
>
> @@ -220,8 +220,6 @@ static void hci_pio_cleanup(struct i3c_hci *hci)
>  		BUG_ON(pio->curr_rx);
>  		BUG_ON(pio->curr_tx);
>  		BUG_ON(pio->curr_resp);
> -		kfree(pio);
> -		hci->io_data = NULL;
>  	}
>  }
>
> --
> 2.51.0
>
>
> --
> linux-i3c mailing list
> linux-i3c at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-i3c



More information about the linux-i3c mailing list