PCI/pwrctl: Use of_platform_device_create() to create pwrctl devices
authorManivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Fri, 25 Oct 2024 07:54:51 +0000 (13:24 +0530)
committerKrzysztof Wilczyński <kwilczynski@kernel.org>
Thu, 21 Nov 2024 16:01:00 +0000 (16:01 +0000)
commit7582fe07f4ca4c560eb47800b640997f06a8baa2
treef6650ddcc31b883dc035c00ace8507f2e88b9993
parent9852d85ec9d492ebef56dc5f229416c925758edc
PCI/pwrctl: Use of_platform_device_create() to create pwrctl devices

The of_platform_populate() API creates platform devices by descending
through the children of the parent node. But it provides no control over
the child nodes, which makes it difficult to add checks for the child
nodes in the future.

Use of_platform_device_create() and for_each_child_of_node_scoped() to make
it possible to add checks for each node before creating the platform
device.

Link: https://lore.kernel.org/r/20241025-pci-pwrctl-rework-v2-1-568756156cbe@linaro.org
Tested-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Tested-by: Krishna chaitanya chundru <quic_krichai@quicinc.com>
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Signed-off-by: Krzysztof Wilczyński <kwilczynski@kernel.org>
Reviewed-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
drivers/pci/bus.c