Re: [PATCH v5 1/3] fpga: xilinx-spi: extract a common driver core

From: Charles Perry
Date: Tue Mar 19 2024 - 09:18:27 EST



On Mar 19, 2024, at 12:20 AM, Xu Yilun yilun.xu@xxxxxxxxxxxxxxx wrote:
>> +/**
>> + * struct xilinx_fpga_core - interface between the driver and the core manager
>> + * of Xilinx 7 Series FPGA manager
>> + * @dev: device node
>> + * @write: write callback of the driver
>> + * @prog_b: PROGRAM_B gpio descriptor
>> + * @init_b: INIT_B gpio descriptor
>> + * @done: DONE gpio descriptor
>
> Please re-check the Documentation again:
> "Structure fields that are inside a private: area are not listed in the
> generated output documentation"
>

I did generate the documentation for that struct and saw that the
private fields are indeed removed. This hinted me into thinking that
I should keep the private kernel-doc, because it's the generator job
to remove those. Looking again at the kernel-doc.rst example on that
topic, I understand that this is not the case, will fix.

>> + */
>> +struct xilinx_fpga_core {
>> +/* public: */
>> + struct device *dev;
>> + int (*write)(struct xilinx_fpga_core *core, const char *buf,
>> + size_t count);
>> +/* private: handled by xilinx-core */
>> + struct gpio_desc *prog_b;
>> + struct gpio_desc *init_b;
>> + struct gpio_desc *done;
>> +};
>> +
> [...]
>> -
>> static int xilinx_spi_probe(struct spi_device *spi)
>> {
>> - struct xilinx_spi_conf *conf;
>> - struct fpga_manager *mgr;
>> + struct xilinx_fpga_core *conf;
>
> Why do you name it conf? Maybe "core" is better?
>
> Thanks,
> Yilun

Yes, I changed the type but not the name.

Thank you for the review,
Charles