Problem
When CONFIG_TH1520_PMIC_WATCHDOG=y, the TH1520 PMIC watchdog driver registers a virtual th1520-wdt platform device unconditionally from its initcall.
On non-TH1520 systems such as ZhiHe A210, this creates an unused th1520-wdt device. The probe then tries to get the TH1520 AON global channel and remains deferred because TH1520 AON is not present.
Observed on A210:
platform th1520-wdt: deferred probe pending
/sys/kernel/debug/devices_deferred also shows:
Expected behavior
The TH1520 PMIC watchdog virtual device should only be registered on TH1520 machines. Non-TH1520 platforms should not get a stale th1520-wdt deferred-probe entry.
Suggested fix
Gate the virtual platform device registration with the root compatible, for example only allowing it when of_machine_is_compatible("thead,th1520") is true.
Problem
When
CONFIG_TH1520_PMIC_WATCHDOG=y, the TH1520 PMIC watchdog driver registers a virtualth1520-wdtplatform device unconditionally from its initcall.On non-TH1520 systems such as ZhiHe A210, this creates an unused
th1520-wdtdevice. The probe then tries to get the TH1520 AON global channel and remains deferred because TH1520 AON is not present.Observed on A210:
/sys/kernel/debug/devices_deferredalso shows:Expected behavior
The TH1520 PMIC watchdog virtual device should only be registered on TH1520 machines. Non-TH1520 platforms should not get a stale
th1520-wdtdeferred-probe entry.Suggested fix
Gate the virtual platform device registration with the root compatible, for example only allowing it when
of_machine_is_compatible("thead,th1520")is true.