Re: [PATCH v1 2/2] mfd: Add Host Interface (HIF) support for Nuvoton NCT6694
From: Ming Yu
Date: Fri Apr 03 2026 - 00:46:32 EST
Dear Marc,
Thanks for the review.
Marc Kleine-Budde <mkl@xxxxxxxxxxxxxx> 於 2026年4月2日週四 下午7:05寫道:
>
> > +struct nct6694_sio_data {
> > + enum nct6694_chips chip;
> > + int sioreg; /* Super-I/O index port */
> > +
> > + /* Super-I/O access functions */
> > + int (*sio_enter)(struct nct6694_sio_data *sio_data);
> > + void (*sio_exit)(struct nct6694_sio_data *sio_data);
> > + void (*sio_select)(struct nct6694_sio_data *sio_data, int ld);
> > + int (*sio_inb)(struct nct6694_sio_data *sio_data, int reg);
> > + int (*sio_inw)(struct nct6694_sio_data *sio_data, int reg);
> > + void (*sio_outb)(struct nct6694_sio_data *sio_data, int reg, int val);
>
> The signatures of the function look a bit strange. I expect functions
> reading/writing bytes use u8 not int, register offsets should probably
> be an unsigned int.
>
> Why do you have pointers to the access functions? Why not use them
> directly?
>
These helpers were originally meant to be used by sub-drivers for SIO
access, but the implementation later converged so that all SIO access
is done in the MFD driver itself. In the next version, I will remove
the function pointers and simplify the interface accordingly.
I will also adjust the types as suggested.
Regards,
Ming