On Tue, Jan 6, 2026 at 3:45 PM Shivendra Pratap
[off-list ref] wrote:
On 1/6/2026 6:04 PM, Bartosz Golaszewski wrote:
quoted
On Mon, Jan 5, 2026 at 7:06 PM Shivendra Pratap
[off-list ref] wrote:
quoted
quoted
quoted
+static int __init psci_reboot_mode_init(void)
+{
+ struct faux_device *fdev;
+
+ fdev = faux_device_create("psci-reboot-mode", NULL, &psci_reboot_mode_ops);
+ if (!fdev)
+ return -ENODEV;
This will always create this device for everyone who includes this
module. Move the of_find_compatible_node(NULL, NULL, "arm,psci-1.0")
call from probe() here instead and don't create the device if it
fails.
Ack.
Will move both calls to init before creating the faux device.
psci_np = of_find_compatible_node(NULL, NULL, "arm,psci-1.0");
and
np = of_find_node_by_name(psci_np, "reboot-mode");
--
On a second glance - and I may be totally wrong - would it be possible
to switch to using the auxiliary bus and create this device from
drivers/firmware/psci/psci.c? That would be even cleaner.
Till v17, device was being created in psci.c. Lorenzo wanted to move it
outside psci similar to design of cpuidle-psci.
https://lore.kernel.org/all/aRIfc9iuC2b9DqI+@lpieralisi/ (local)
Thanks for the link. Right, there's no actual psci driver binding to a
struct device, rather we only have a set of functions called very
early into the boot process.
Nevermind this comment
Bart