Hi Boris, Boris Brezillon <bbrezillon@xxxxxxxxxx> wrote on Mon, 25 Feb 2019 19:55:43 +0100: > On Thu, 21 Feb 2019 11:01:52 +0100 > Miquel Raynal <miquel.raynal@xxxxxxxxxxx> wrote: > > > + > > +/** > > + * struct nand_ecc_engine_ops - Generic ECC engine operations > > + * > > + * @init_ctx: given a desired user configuration for the pointed NAND device, > > + * requests the ECC engine driver to setup a configuration with > > + * values it supports. > > + * @cleanup_ctx: clean the context initialized by @init_ctx. > > + * @prepare_io_req: is called before reading/writing a page to prepare the I/O > > + * request to be performed with ECC correction. > > + * @finish_io_req: is called after reading/writing a page to terminate the I/O > > + * request and ensure proper ECC correction. > > + */ > > +struct nand_ecc_engine_ops { > > We might want to add a > > void (*put_engine)(struct nand_ecc_engine *engine); > > here if we want the nanddev cleanup path to be generic. > This hook would be implemented by drivers where the ECC engine object is > refcounted (typically the case for HW ECC engines shared by the raw NAND > controller and the SPI controller). > > Alternatively, you can just add one nand_put_xxx_ecc_engine() func per > engine class (SW, ondie and HW). Can't this be handled in the init/cleanup_ctx() path directly? Furthermore if this is just a hook to do reference counting. Thanks, Miquèl ______________________________________________________ Linux MTD discussion mailing list http://lists.infradead.org/mailman/listinfo/linux-mtd/