Re: [PATCH v7] staging: rtl8723bs: Add error handling for sd_read()
From: Greg KH
Date: Tue Apr 15 2025 - 09:01:57 EST
On Tue, Apr 15, 2025 at 08:28:18PM +0800, Wentao Liang wrote:
> >Again, I think this whole "hal wrapper" should be removed instead, and
> >not papered over like this. If you dig deep enough, it all boils down
> >to a call to sdio_readb(), which is an 8 bit read, so the alignment
> >issues are not a problem, and if an error happens the proper error value>
> >is returned from that saying what happened. Why not work on that like I
> >recommended? That would allow for at least 3, if not more, layers of
> >indirection to be removed from this driver, making it more easy to
> >understand and maintain over time.
>
> Thanks for the guidance and detailed suggestion. But remove the whole
> "hal wrapper" layer is beyond my capability. Perhaps this refactoring
> work would be better handled by someone with deeper knowledge of the
> driver codebase. The changes would ripple through several layers, and
> I'm not entirely confident about implementing them correctly. The
> current patch might serve as a reasonable stopgap solution.
Try it, it should be a "one step at a time" of unwinding the mess that
the codebase is in. Shouldn't be that hard, and will give you lots of
good things to work on.
I don't want to take a "stopgap solution", sorry, I would rather take
the real solution, for obvious reasons.
thanks,
greg k-h