Re: [PATCH] usb: apple-mfi-fastcharge: Convert to devm resources
From: Greg Kroah-Hartman
Date: Sat Jun 13 2026 - 23:41:52 EST
On Sat, Jun 13, 2026 at 01:18:51PM -0700, Rosen Penev wrote:
> Use devm_kzalloc(), devm_kasprintf(), and devm_power_supply_register()
> to let the driver core handle resource cleanup. This allows removing
> the mfi_fc_disconnect() function and the error labels in probe.
Please don't do this on old drivers unless you have the hardware to test
that the change worked properly.
> Also take the opportunity to shrink the private struct and move the
> variables in probe as devm doesn't need them in the struct.
Shouldn't this be a separate change?
thanks,
greg k-h