Commit caf2cd61 authored by Sudeep Holla's avatar Sudeep Holla Committed by Will Deacon
Browse files

firmware: arm_sdei: Drop check for /firmware/ node and always register driver



As with most of the drivers, let us register this driver unconditionally
by dropping the checks for presence of firmware nodes(DT) or entries(ACPI).

Further, as mentioned in the commit acafce48 ("firmware: arm_sdei:
Fix DT platform device creation"), the core takes care of creation of
platform device when the appropriate device node is found and probe
is called accordingly.

Let us check only for the presence of ACPI firmware entry before creating
the platform device and flag warning if we fail.

Signed-off-by: default avatarSudeep Holla <sudeep.holla@arm.com>
Reviewed-by: default avatarJames Morse <james.morse@arm.com>
Cc: James Morse <james.morse@arm.com>
Link: https://lore.kernel.org/r/20200422122823.1390-1-sudeep.holla@arm.com


Signed-off-by: default avatarWill Deacon <will@kernel.org>
parent 6a8b55ed
Loading
Loading
Loading
Loading
+12 −25
Original line number Original line Diff line number Diff line
@@ -1079,26 +1079,9 @@ static struct platform_driver sdei_driver = {
	.probe		= sdei_probe,
	.probe		= sdei_probe,
};
};


static bool __init sdei_present_dt(void)
{
	struct device_node *np, *fw_np;

	fw_np = of_find_node_by_name(NULL, "firmware");
	if (!fw_np)
		return false;

	np = of_find_matching_node(fw_np, sdei_of_match);
	if (!np)
		return false;
	of_node_put(np);

	return true;
}

static bool __init sdei_present_acpi(void)
static bool __init sdei_present_acpi(void)
{
{
	acpi_status status;
	acpi_status status;
	struct platform_device *pdev;
	struct acpi_table_header *sdei_table_header;
	struct acpi_table_header *sdei_table_header;


	if (acpi_disabled)
	if (acpi_disabled)
@@ -1113,20 +1096,24 @@ static bool __init sdei_present_acpi(void)
	if (ACPI_FAILURE(status))
	if (ACPI_FAILURE(status))
		return false;
		return false;


	pdev = platform_device_register_simple(sdei_driver.driver.name, 0, NULL,
					       0);
	if (IS_ERR(pdev))
		return false;

	return true;
	return true;
}
}


static int __init sdei_init(void)
static int __init sdei_init(void)
{
{
	if (sdei_present_dt() || sdei_present_acpi())
	int ret = platform_driver_register(&sdei_driver);
		platform_driver_register(&sdei_driver);


	return 0;
	if (!ret && sdei_present_acpi()) {
		struct platform_device *pdev;

		pdev = platform_device_register_simple(sdei_driver.driver.name,
						       0, NULL, 0);
		if (IS_ERR(pdev))
			pr_info("Failed to register ACPI:SDEI platform device %ld\n",
				PTR_ERR(pdev));
	}

	return ret;
}
}


/*
/*