19 May
2020
19 May
'20
12:53 p.m.
On Tue, May 19, 2020 at 01:16:54AM +0800, Vijendar Mukunda wrote:
- adata->res = devm_kzalloc(&pci->dev,
sizeof(struct resource) * 2,
GFP_KERNEL);
- if (!adata->res) {
ret = -ENOMEM;
goto de_init;
- }
- adata->res[0].name = "acp_pdm_iomem";
- adata->res[0].flags = IORESOURCE_MEM;
- adata->res[0].start = addr;
- adata->res[0].end = addr + (ACP_REG_END - ACP_REG_START);
- adata->res[1].name = "acp_pdm_irq";
- adata->res[1].flags = IORESOURCE_IRQ;
- adata->res[1].start = pci->irq;
- adata->res[1].end = pci->irq;
Creating the subdevice is good and sensible but this is basically open coding what the MFD framework does. The subdevices should probably be created with that instead.