Skip to content

Commit

Permalink
ASoC: uniphier: aio-core: Make some read-only arrays static const
Browse files Browse the repository at this point in the history
Don't populate the read-only arrays slotsel_2ch, slotsel_multi, v_pll
and v_div on the stack but instead make them static const. Also makes
the object code a little smaller.

Signed-off-by: Colin Ian King <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
  • Loading branch information
ColinIanKing authored and broonie committed Dec 5, 2022
1 parent e110ede commit cb870fd
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions sound/soc/uniphier/aio-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -277,17 +277,18 @@ void aio_port_reset(struct uniphier_aio_sub *sub)
static int aio_port_set_ch(struct uniphier_aio_sub *sub)
{
struct regmap *r = sub->aio->chip->regmap;
u32 slotsel_2ch[] = {
static const u32 slotsel_2ch[] = {
0, 0, 0, 0, 0,
};
u32 slotsel_multi[] = {
static const u32 slotsel_multi[] = {
OPORTMXTYSLOTCTR_SLOTSEL_SLOT0,
OPORTMXTYSLOTCTR_SLOTSEL_SLOT1,
OPORTMXTYSLOTCTR_SLOTSEL_SLOT2,
OPORTMXTYSLOTCTR_SLOTSEL_SLOT3,
OPORTMXTYSLOTCTR_SLOTSEL_SLOT4,
};
u32 mode, *slotsel;
u32 mode;
const u32 *slotsel;
int i;

switch (params_channels(&sub->params)) {
Expand Down Expand Up @@ -515,13 +516,13 @@ static int aio_port_set_clk(struct uniphier_aio_sub *sub)
struct uniphier_aio_chip *chip = sub->aio->chip;
struct device *dev = &sub->aio->chip->pdev->dev;
struct regmap *r = sub->aio->chip->regmap;
u32 v_pll[] = {
static const u32 v_pll[] = {
OPORTMXCTR2_ACLKSEL_A1, OPORTMXCTR2_ACLKSEL_F1,
OPORTMXCTR2_ACLKSEL_A2, OPORTMXCTR2_ACLKSEL_F2,
OPORTMXCTR2_ACLKSEL_A2PLL,
OPORTMXCTR2_ACLKSEL_RX1,
};
u32 v_div[] = {
static const u32 v_div[] = {
OPORTMXCTR2_DACCKSEL_1_2, OPORTMXCTR2_DACCKSEL_1_3,
OPORTMXCTR2_DACCKSEL_1_1, OPORTMXCTR2_DACCKSEL_2_3,
};
Expand Down

0 comments on commit cb870fd

Please sign in to comment.