On Mon, Nov 23, 2020 at 05:19:06PM +0800, Qing Zhang wrote: > +static struct platform_device loongson_spi_device = { > + .name = "loongson-spi", > + .id = 0, > + .num_resources = ARRAY_SIZE(loongson_spi_resources), > + .resource = loongson_spi_resources, > +}; Why isn't this struct allocated at runtime? > + if (ret == PCIBIOS_SUCCESSFUL) { > + loongson_spi_resources[1].start = v8; > + loongson_spi_resources[1].end = v8; > + platform_device_register(&loongson_spi_device); > + } > + > +err_out: > + return ret; > +} > + > +static void loongson_spi_pci_unregister(struct pci_dev *pdev) > +{ > + pci_release_region(pdev, 0); > +} Seems like platform_device_unregister() is missing here. Thanks, Lukas