[PATCH v3 22/29] acpi: Add a method to write tables for a device
Simon Glass
sjg at chromium.org
Wed Apr 8 04:57:51 CEST 2020
Hi Andy,
On Fri, 3 Apr 2020 at 07:20, Andy Shevchenko
<andriy.shevchenko at linux.intel.com> wrote:
>
> 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?
There isn't one...that would be an error. We want to get a compiler
warning if we leave something out.
>
> > + }
> > +
> > + 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.
OK will separate it out.
Regards,
Simon
More information about the U-Boot
mailing list