Re: [PATCH] usb: apple-mfi-fastcharge: Convert to devm resources
From: Greg Kroah-Hartman
Date: Sat Jun 13 2026 - 23:57:50 EST
On Sat, Jun 13, 2026 at 08:45:02PM -0700, Rosen Penev wrote:
> On Sat, Jun 13, 2026 at 8:41 PM Greg Kroah-Hartman
> <gregkh@xxxxxxxxxxxxxxxxxxx> wrote:
> >
> > 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.
> iPhones? I have those. I also have a USB power meter.
And did you test this change out with all of that? If you do, please
say so.
But again, there is no need to change existing code to use devm_* calls
unless it fixes a bug. devm can be tricky and is not always a good
idea.
thanks,
greg k-h