Re: [PATCH v2 1/3] crypto: ccp - Use devres interface to allocate PCI/iomap and cleanup

From: Brijesh Singh
Date: Mon Jun 26 2017 - 18:22:21 EST




On 06/26/2017 04:17 PM, Tom Lendacky wrote:
+const struct ccp_vdata ccpv3_platform = {
+ .version = CCP_VERSION(3, 0),
+ .setup = NULL,
+ .perform = &ccp3_actions,
+ .bar = 2,

Platform devices don't use BARs so should probably delete this (unless
you want to make it more generic and then use this value for the
IORESOURCE_MEM entry).


Yep, we don't need bar for platform device, it was copy paste from existing
ccpv3 structure. I will fix it in v3. thanks

+}
#endif
+int ccp_dev_init(struct ccp_device *ccp)
+{
+ if (ccp->vdata->setup)
+ ccp->vdata->setup(ccp);
+
+ ccp->io_regs = ccp->io_map + ccp->vdata->offset;

This should be before the above call to setup().


Good catch, actually the second patch takes care of it. But I agree with your
feedback, I will make sure that io_regs is set before invoking the setup() in
the first patch itself.


Thanks
Brijesh