diff options
| author | Adrian Hunter <adrian.hunter@intel.com> | 2026-01-13 10:26:47 +0300 |
|---|---|---|
| committer | Alexandre Belloni <alexandre.belloni@bootlin.com> | 2026-01-14 19:21:09 +0300 |
| commit | 11d17c2855bfc04550557017eae02e92f3eeab1c (patch) | |
| tree | f74f3483763a7a3d1c24298d48524ea843413385 | |
| parent | f64c1a46ea7c40bbab57a0cb1665a1c1e11da6af (diff) | |
| download | linux-11d17c2855bfc04550557017eae02e92f3eeab1c.tar.xz | |
i3c: mipi-i3c-hci: Switch PIO data allocation to devm_kzalloc()
The driver already uses managed resources, so convert the PIO data
structure allocation to devm_zalloc(). Remove the manual kfree().
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Link: https://patch.msgid.link/20260113072702.16268-7-adrian.hunter@intel.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
| -rw-r--r-- | drivers/i3c/master/mipi-i3c-hci/pio.c | 4 |
1 files changed, 1 insertions, 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; } } |
