1// SPDX-License-Identifier: ISC
2/*
3 * Copyright (c) 2012 Broadcom Corporation
4 */
5
6#include <linux/device.h>
7#include <linux/module.h> /* bug in tracepoint.h, it should include this */
8
9#ifndef __CHECKER__
10#define CREATE_TRACE_POINTS
11#include "bus.h"
12#include "tracepoint.h"
13#include "debug.h"
14
15void __brcmf_err(struct brcmf_bus *bus, const char *func, const char *fmt, ...)
16{
17	struct va_format vaf = {
18		.fmt = fmt,
19	};
20	va_list args;
21
22	va_start(args, fmt);
23	vaf.va = &args;
24	if (bus)
25		dev_err(bus->dev, "%s: %pV", func, &vaf);
26	else
27		pr_err("%s: %pV", func, &vaf);
28	trace_brcmf_err(func, &vaf);
29	va_end(args);
30}
31
32#endif
33