[PATCH v4 4/6] spmi: apple: Implement remaining commands

Sasha Finkelstein k at chaosmail.tech
Wed Aug 5 09:54:21 PDT 2026


On Aug 5, 2026, at 14:19, Janne Grunau <j at jannau.net> wrote:
>> 
>> -static int spmi_read_cmd(struct spmi_controller *ctrl, u8 opc, u8 sid,
>> -  u16 saddr, u8 *buf, size_t len)
>> +static int spmi_raw_cmd(struct spmi_controller *ctrl, u8 opc, u8 sid,
>> +  u16 param, const u8 *buf, size_t len, u8 *ibuf, size_t ilen)
> 
> Instead of two sets of not very distinctive variable names ("buf"/"len",
> "ibuf"/ilen") please use just buf/len and a boolean to indicate whether
> the command is a read or write if you insists of routing all commands
> through a single function. This can be simply added as first condition
> in the "while" iterating over the write/read buffers.

Tried it, ended up not working, as the buffers differ in constness






More information about the linux-arm-kernel mailing list