Re: [PATCH v3 3/4] HID: wiimote: use scoped cleanup in wiimote and led probes
"Rafael Passos" <[email protected]> Sat, 01 Aug 2026 21:24:50 -0300
| Newsgroups | org.kernel.vger.linux-input |
|---|---|
| Message-ID | <[email protected]> |
On Fri Jul 31, 2026 at 8:18 AM -03, David Rheinsberg wrote: > Hi > > On Wed, Jul 29, 2026, at 6:49 PM, Rafael Passos wrote: >> Cleanup code in wiimote/led probe function, using the scoped cleanup. >> This prevents mistakes in future changes to this function. >> >> In wiimote_probe_clenaup, a few functions are safe to call without >> checking. For the hid_hw calls, a new bit mask was introduced to track >> probing state. > > Is this patch worth it? the led-probe looks ok, but the wiimote_probe() change looks convoluted. If you really want to go that route I would prefer if you reuse wiimote_destroy() and ensure it checks for the right conditions, rather than adding __wiimote_probe_cleanup(). > > Thanks > David That's a good point. I will try merging the cleanup and destroy functions. If it is still not good, we can just go back to the v1 for this commit. Thanks, Rafael Passos