Re: [PATCH v5 2/2] EDAC: add EDAC driver for DMC520
From: Borislav Petkov
Date: Mon Aug 19 2019 - 05:31:05 EST
On Tue, Aug 13, 2019 at 01:05:02AM +0000, Lei Wang wrote:
> Added some more comments for the file:
>
> /*
> * dmc520_edac.c, EDAC driver for DMC-520 memory controller
^^^^^^^^^^^^^
Filename is redundant.
> These comments tell how to potentially expand the driver functions to
> support more interrupts besides what are already here.
I can read that - the question is why are they there and for whom? For
your future colleagues who'll take over this driver or what is those
comments' purpose?
> As above comments, this comment is to guide potential future adding to
> this driver to support other interrupts.
See question above.
> After edac_mc_alloc(), if succeeds, the above code updates dmc520_edac
> struct data. If moving edac_mc_alloc as suggested, I will need to use
> local variables to store the data,
Yes, do that pls.
> Do you mean having an array to keep all the irq_id, and then only
> devm_request_irq on them if all of the platform_get_irq are success?
No, move it before edac_mc_alloc().
In general, do *all* initialization of your hardware first and only
then, when it succeeds, allocate the EDAC structures.
Thx.
--
Regards/Gruss,
Boris.
Good mailing practices for 400: avoid top-posting and trim the reply.