Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Phytium] [Deepin Kernel SIG] Fix compile errors with clang-19 #504

Merged
3 changes: 2 additions & 1 deletion drivers/i3c/master/i3c-master-phytium.c
Original file line number Diff line number Diff line change
Expand Up @@ -1666,7 +1666,8 @@ static int phytium_i3c_master_probe(struct platform_device *pdev)
{
struct phytium_i3c_master *master;
struct resource *res;
int ret, irq;
int ret = -EINVAL;
int irq;
u32 val;

master = devm_kzalloc(&pdev->dev, sizeof(*master), GFP_KERNEL);
Expand Down
1 change: 1 addition & 0 deletions drivers/net/ethernet/phytium/phytmac_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1816,6 +1816,7 @@ static int phytmac_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
break;
#endif
default:
ret = -EOPNOTSUPP;
break;
}

Expand Down
1 change: 1 addition & 0 deletions drivers/net/ethernet/phytium/phytmac_platform.c
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ static int phytmac_plat_probe(struct platform_device *pdev)
pdata->msg_regs = ioremap_wt(regs->start, MEMORY_SIZE);
if (!pdata->msg_regs) {
dev_err(&pdev->dev, "msg_regs ioremap failed, i=%d\n", i);
ret = PTR_ERR(pdata->mac_regs);
goto err_mem;
}
}
Expand Down
3 changes: 2 additions & 1 deletion drivers/pwm/pwm-phytium.c
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,8 @@ static int pwm_phytium_set_dbcly(struct pwm_chip *chip, unsigned int updbcly, un
{
struct phytium_pwm_chip *our_chip = to_phytium_pwm_chip(chip);
u32 reg;
u64 dbcly, cycles, upcycles, dwcycles;
u64 cycles, upcycles, dwcycles;
u64 dbcly = 0;

reg = readl(our_chip->base + REG_TPERIOD);
if (has_acpi_companion(chip->dev))
Expand Down
2 changes: 1 addition & 1 deletion drivers/usb/phytium/host.c
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,7 @@ static void hostErrorIrq(struct HOST_CTRL *priv)

rxerrirq = phytium_read16(&priv->regs->rxerrirq);
rxerrien = phytium_read16(&priv->regs->rxerrien);
rxerrirq &= rxerrirq;
rxerrirq &= rxerrien;
if (!txerrirq && !rxerrirq)
return;

Expand Down
40 changes: 20 additions & 20 deletions sound/soc/phytium/phytium_i2s.c
Original file line number Diff line number Diff line change
Expand Up @@ -975,33 +975,25 @@ static const u32 fifo_width[COMP_MAX_WORDSIZE] = {
12, 16, 20, 24, 32, 0, 0, 0
};

/* Width of (DMA) bus */
static const u32 bus_widths[COMP_MAX_DATA_WIDTH] = {
DMA_SLAVE_BUSWIDTH_1_BYTE,
DMA_SLAVE_BUSWIDTH_2_BYTES,
DMA_SLAVE_BUSWIDTH_4_BYTES,
DMA_SLAVE_BUSWIDTH_UNDEFINED
};

/* PCM format to support channel resolution */
static const u32 formats[COMP_MAX_WORDSIZE] = {
SNDRV_PCM_FMTBIT_S16_LE,
SNDRV_PCM_FMTBIT_S16_LE,
SNDRV_PCM_FMTBIT_S24_LE,
SNDRV_PCM_FMTBIT_S24_LE,
SNDRV_PCM_FMTBIT_S32_LE,
0,
0,
0
};

static int phytium_configure_dai(struct i2s_phytium *dev)
{
u32 comp1 = i2s_read_reg(dev->regs, dev->i2s_reg_comp1);
u32 comp2 = i2s_read_reg(dev->regs, dev->i2s_reg_comp2);
u32 fifo_depth = 1 << (1 + COMP1_FIFO_DEPTH_GLOBAL(comp1));
u32 idx;

/* PCM format to support channel resolution */
static const u32 formats[COMP_MAX_WORDSIZE] = {
SNDRV_PCM_FMTBIT_S16_LE,
SNDRV_PCM_FMTBIT_S16_LE,
SNDRV_PCM_FMTBIT_S24_LE,
SNDRV_PCM_FMTBIT_S24_LE,
SNDRV_PCM_FMTBIT_S32_LE,
0,
0,
0
};

if (COMP1_TX_ENABLED(comp1)) {
dev_dbg(dev->dev, " phytium: play supported\n");
idx = COMP1_TX_WORDSIZE_0(comp1);
Expand Down Expand Up @@ -1038,6 +1030,14 @@ static int phytium_configure_dai_by_dt(struct i2s_phytium *dev)
u32 idx2;
int ret;

/* Width of (DMA) bus */
static const u32 bus_widths[COMP_MAX_DATA_WIDTH] = {
DMA_SLAVE_BUSWIDTH_1_BYTE,
DMA_SLAVE_BUSWIDTH_2_BYTES,
DMA_SLAVE_BUSWIDTH_4_BYTES,
DMA_SLAVE_BUSWIDTH_UNDEFINED
};

if (WARN_ON(idx >= ARRAY_SIZE(bus_widths)))
return -EINVAL;

Expand Down
Loading