From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andy Shevchenko Date: Fri, 3 Apr 2020 16:20:17 +0300 Subject: [PATCH v3 22/29] acpi: Add a method to write tables for a device In-Reply-To: <20200330171226.v3.22.I04c496e973a0d5eb09ed6f6e4674c300fc34b605@changeid> References: <20200330231305.130488-1-sjg@chromium.org> <20200330171226.v3.22.I04c496e973a0d5eb09ed6f6e4674c300fc34b605@changeid> Message-ID: <20200403132017.GH3676135@smile.fi.intel.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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