memremap: pass a struct dev_pagemap to ->kill and ->cleanup

Passing the actual typed structure leads to more understandable code
vs just passing the ref member.

Reported-by: Logan Gunthorpe <logang@deltatee.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Logan Gunthorpe <logang@deltatee.com>
Reviewed-by: Jason Gunthorpe <jgg@mellanox.com>
Reviewed-by: Dan Williams <dan.j.williams@intel.com>
Tested-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
This commit is contained in:
Christoph Hellwig
2019-06-26 14:27:09 +02:00
committed by Jason Gunthorpe
parent 1e240e8d4a
commit d8668bb045
7 changed files with 33 additions and 32 deletions

View File

@@ -102,8 +102,8 @@ static void nfit_test_kill(void *_pgmap)
WARN_ON(!pgmap || !pgmap->ref || !pgmap->ops || !pgmap->ops->kill ||
!pgmap->ops->cleanup);
pgmap->ops->kill(pgmap->ref);
pgmap->ops->cleanup(pgmap->ref);
pgmap->ops->kill(pgmap);
pgmap->ops->cleanup(pgmap);
}
void *__wrap_devm_memremap_pages(struct device *dev, struct dev_pagemap *pgmap)