acrn-kernel/drivers/fpga
Alexis Lothoré 71b6df69f1 fpga: bridge: properly initialize bridge device before populating children
commit dc70eb868b upstream.

The current code path can lead to warnings because of uninitialized device,
which contains, as a consequence, uninitialized kobject. The uninitialized
device is passed to of_platform_populate, which will at some point, while
creating child device, try to get a reference on uninitialized parent,
resulting in the following warning:

kobject: '(null)' ((ptrval)): is not initialized, yet kobject_get() is
being called.

The warning is observed after migrating a kernel 5.10.x to 6.1.x.
Reverting commit 0d70af3c25 ("fpga: bridge: Use standard dev_release for
class driver") seems to remove the warning.
This commit aggregates device_initialize() and device_add() into
device_register() but this new call is done AFTER of_platform_populate

Fixes: 0d70af3c25 ("fpga: bridge: Use standard dev_release for class driver")
Signed-off-by: Alexis Lothoré <alexis.lothore@bootlin.com>
Acked-by: Xu Yilun <yilun.xu@intel.com>
Link: https://lore.kernel.org/r/20230404133102.2837535-2-alexis.lothore@bootlin.com
Signed-off-by: Xu Yilun <yilun.xu@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-04-26 14:28:43 +02:00
..
Kconfig
Makefile
altera-cvp.c
altera-fpga2sdram.c
altera-freeze-bridge.c
altera-hps2fpga.c
altera-pr-ip-core-plat.c
altera-pr-ip-core.c
altera-ps-spi.c
dfl-afu-dma-region.c
dfl-afu-error.c
dfl-afu-main.c
dfl-afu-region.c
dfl-afu.h
dfl-fme-br.c
dfl-fme-error.c
dfl-fme-main.c
dfl-fme-mgr.c
dfl-fme-perf.c
dfl-fme-pr.c
dfl-fme-pr.h
dfl-fme-region.c
dfl-fme.h
dfl-n3000-nios.c
dfl-pci.c
dfl.c
dfl.h
fpga-bridge.c fpga: bridge: properly initialize bridge device before populating children 2023-04-26 14:28:43 +02:00
fpga-mgr.c
fpga-region.c
ice40-spi.c
intel-m10-bmc-sec-update.c
machxo2-spi.c
microchip-spi.c
of-fpga-region.c
socfpga-a10.c
socfpga.c
stratix10-soc.c
ts73xx-fpga.c
versal-fpga.c
xilinx-pr-decoupler.c
xilinx-spi.c
zynq-fpga.c
zynqmp-fpga.c