summaryrefslogtreecommitdiff
path: root/xmalloc.h
blob: e1e4f8f979a87e6d6eb1c28f49a038590f487a26 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#ifndef XMALLOC_H
#define XMALLOC_H

#include <stdlib.h>

#include "built_in.h"
#include "die.h"

extern void *xmalloc(size_t size) __hidden;
extern void *xzmalloc(size_t size) __hidden;
extern void *xmallocz(size_t size) __hidden;
extern void *xmalloc_aligned(size_t size, size_t alignment) __hidden;
extern void *xzmalloc_aligned(size_t size, size_t alignment) __hidden;
extern void *xmemdupz(const void *data, size_t len) __hidden;
extern void *xrealloc(void *ptr, size_t nmemb, size_t size) __hidden;
extern void xfree_func(void *ptr) __hidden;
extern char *xstrdup(const char *str) __hidden;
extern char *xstrndup(const char *str, size_t size) __hidden;

static inline void __xfree(void *ptr)
{
        if (unlikely((ptr) == NULL))
                panic("xfree: NULL pointer given as argument\n");
        free(ptr);
}

#define xfree(ptr)	\
do {			\
	__xfree(ptr);	\
	(ptr) = NULL;	\
} while (0)

#endif /* XMALLOC_H */
olspan='2' class='oid'>9a274499c8b25b2d751b09936fbde4105477a92a /Documentation/i2c parent92e963f50fc74041b5e9e744c330dca48e04f08d (diff)
ASoC: mxs-saif: check BUSY bit in hw_params() only if not mclk_in_use
If something else, typically a codec, has enabled mclk, the BUSY bit may be set when hw_params() is called without this being an error. This check thus causes intermittent failures to configure the sound device when used in such a manner. Fix this by making the test conditional on !saif->mclk_in_use. Signed-off-by: Mans Rullgard <mans@mansr.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'Documentation/i2c')