On Tue, 22 Oct 2024 at 12:28, Manivannan Sadhasivam via B4 Relay <devnull+manivannan.sadhasivam.linaro.org@xxxxxxxxxx> wrote: > > From: Manivannan Sadhasivam <manivannan.sadhasivam@xxxxxxxxxx> > > Currently, pwrctl devices are created if the corresponding PCI nodes are > defined in devicetree. But this is not correct, because not all PCI nodes > defined in devicetree require pwrctl support. Pwrctl comes into picture > only when the device requires kernel to manage its power state. This can > be determined using the power supply properties present in the devicetree > node of the device. > > So add a new API, of_pci_is_supply_present() that checks the devicetree > node if at least one power supply property is present or not. If present, > then the pwrctl device will be created for that PCI node. Otherwise, it > will be skipped. > > Cc: stable+noautosel@xxxxxxxxxx # Depends on of_platform_device_create() rework > Fixes: 8fb18619d910 ("PCI/pwrctl: Create platform devices for child OF nodes of the port node") > Suggested-by: Dmitry Baryshkov <dmitry.baryshkov@xxxxxxxxxx> > Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@xxxxxxxxxx> > --- Reviewed-by: Bartosz Golaszewski <bartosz.golaszewski@xxxxxxxxxx>