[PATCH v3 22/29] acpi: Add a method to write tables for a device

Andy Shevchenko andriy.shevchenko at linux.intel.com
Fri Apr 3 15:20:17 CEST 2020


On Mon, Mar 30, 2020 at 05:12:58PM -0600, Simon Glass wrote:
> A device may want to write out ACPI tables to describe itself to Linux.
> Add a method to permit this.

> +acpi_method acpi_get_method(struct udevice *dev, enum method_t method)
> +{
> +	struct acpi_ops *aops;
> +
> +	aops = device_get_acpi_ops(dev);
> +	if (aops) {
> +		switch (method) {
> +		case METHOD_WRITE_TABLES:
> +			return aops->write_tables;
> +		}

Where is default?

> +	}
> +
> +	return NULL;

Perhaps,

	if (!aops)
		return NULL;

	switch (method) {
		...
	default:
		return NULL;
	}

> +}

...

> +		log_debug("\n- %s %p\n", parent->name, func);

Leading '\n' in the messages is not good idea.
It might work nicely in U-Boot, but in general better to avoid.


-- 
With Best Regards,
Andy Shevchenko




More information about the U-Boot mailing list