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:
Ed Maste 2017-08-11 18:09:26 +00:00
parent 45f1312387
commit 9432a9bd9f
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=322409

View File

@ -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);