/*
* Subject to the GPL, version 2.
*/
#include "xmalloc.h"
struct panic_handler {
void *arg;
pid_t pid;
bool is_enabled;
void (*on_panic)(void *arg);
struct panic_handler *next;
};
static struct panic_handler *panic_handlers;
void panic_handler_add(void (*on_panic)(void *arg), void *arg)
{
struct panic_handler *handler = xmallocz(sizeof(*handler));
handler->arg = arg;
handler->pid = getpid();
handler->is_enabled = true;
handler->on_panic = on_panic;
handler->next = panic_handlers;
panic_handlers = handler;
};
void call_panic_handlers(void)
{
struct panic_handler *it;
pid_t pid = getpid();
for (it = panic_handlers; it; it = it->next) {
if (it->pid == pid && it->is_enabled) {
it->is_enabled = false;
it->on_panic(it->arg);
}
}
}
/'>
regulator: fixed: Revert support for ACPI interface
This reverts commit 13bed58ce874 (regulator: fixed: add support for ACPI
interface).
While there does appear to be a practical need to manage regulators on ACPI
systems, using ad-hoc properties to describe regulators to the kernel presents
a number of problems (especially should ACPI gain first class support for such
things), and there are ongoing discussions as to how to manage this.
Until there is a rough consensus, revert commit 13bed58ce8748d43, which hasn't
been in a released kernel yet as discussed in [1] and the surrounding thread.
[1] http://lkml.kernel.org/r/20170125184949.x2wkoo7kbaaajkjk@sirena.org.uk
Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Cc: Liam Girdwood <lgirdwood@gmail.com>
Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Cc: Lu Baolu <baolu.lu@linux.intel.com>
Cc: Mark Brown <broonie@kernel.org>
Cc: Rafael J. Wysocki <rafael@kernel.org>
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>