mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
Rename at91_pmc's M_PMC malloc type to avoid duplicate definition
M_PMC is defined in sys/dev/hwpmc/hwpmc_mod.c, and the LINT kernel build fails when linking with lld due to a duplicate symbol error. Sponsored by: The FreeBSD Foundation
This commit is contained in:
parent
45f1312387
commit
9432a9bd9f
1 changed files with 6 additions and 6 deletions
|
|
@ -63,8 +63,8 @@ static struct at91_pmc_softc {
|
|||
|
||||
static uint32_t pllb_init;
|
||||
|
||||
MALLOC_DECLARE(M_PMC);
|
||||
MALLOC_DEFINE(M_PMC, "at91_pmc_clocks", "AT91 PMC Clock descriptors");
|
||||
MALLOC_DECLARE(M_PMC_CLK);
|
||||
MALLOC_DEFINE(M_PMC_CLK, "at91_pmc_clocks", "AT91 PMC Clock descriptors");
|
||||
|
||||
#define AT91_PMC_BASE 0xffffc00
|
||||
|
||||
|
|
@ -300,12 +300,12 @@ at91_pmc_clock_add(const char *name, uint32_t irq,
|
|||
struct at91_pmc_clock *clk;
|
||||
int i, buflen;
|
||||
|
||||
clk = malloc(sizeof(*clk), M_PMC, M_NOWAIT | M_ZERO);
|
||||
clk = malloc(sizeof(*clk), M_PMC_CLK, M_NOWAIT | M_ZERO);
|
||||
if (clk == NULL)
|
||||
goto err;
|
||||
|
||||
buflen = strlen(name) + 1;
|
||||
clk->name = malloc(buflen, M_PMC, M_NOWAIT);
|
||||
clk->name = malloc(buflen, M_PMC_CLK, M_NOWAIT);
|
||||
if (clk->name == NULL)
|
||||
goto err;
|
||||
|
||||
|
|
@ -326,8 +326,8 @@ at91_pmc_clock_add(const char *name, uint32_t irq,
|
|||
err:
|
||||
if (clk != NULL) {
|
||||
if (clk->name != NULL)
|
||||
free(clk->name, M_PMC);
|
||||
free(clk, M_PMC);
|
||||
free(clk->name, M_PMC_CLK);
|
||||
free(clk, M_PMC_CLK);
|
||||
}
|
||||
|
||||
panic("could not allocate pmc clock '%s'", name);
|
||||
|
|
|
|||
Loading…
Reference in a new issue