Re: [PATCH v2 4/7] spmi: apple: Implement remaining commands
From: Sasha Finkelstein
Date: Sun Aug 02 2026 - 07:34:28 EST
On Aug 2, 2026, at 13:18, Janne Grunau <j@xxxxxxxxxx> wrote:
[...]
>> if (!(readl(spmi->regs + SPMI_STATUS_REG) & SPMI_RX_FIFO_EMPTY))
>> dev_warn(&ctrl->dev, "FIFO has extra data\n");
>>
>> - if ((~reply >> SPMI_REPLY_FRAME_PARITY_OFFSET) & ((1 << len) - 1)) {
>> + if (!ilen && !(reply & SPMI_REPLY_ACK)) {
>> + dev_err(&ctrl->dev, "command not acknowledged\n");
>> + return -EIO;
>> + }
>> + if ((~reply >> SPMI_REPLY_FRAME_PARITY_OFFSET) & ((1 << ilen) - 1)) {
>
> Is the parity check useful for write commands? I'm not sure if packing
> all command processing into a single function is a good idea for code
> readability. The diff is annoying to read.
Not useful, but on the contrary I like that every command is sent via
a unified path, instead of using similar, but slightly different
functions