Re: [PATCH v2 1/2] SPI: Add SPI driver for Sunplus SP7021

From: Mark Brown
Date: Thu Nov 18 2021 - 08:38:30 EST


On Wed, Nov 17, 2021 at 09:11:08AM +0000, Lh Kuo 郭力豪 wrote:

> The main function are as follows
>
> The sp7021_spi_mas_transfer_one is replace the transfer_one_message function.
>
> static int sp7021_spi_mas_transfer_one(struct spi_controller *ctlr,
> struct spi_device *spi, struct spi_transfer *xfer)
> {
> struct sp7021_spi_ctlr *pspim = spi_master_get_devdata(ctlr);
> u32 reg_temp = 0;
> unsigned long timeout = msecs_to_jiffies(1000);

I'm still not clear why this needs to be transfer_one_message() and not
just transfer_one()? The whole thing with copying everything into a
buffer is a bit confusing to me.

> The probe function is as follows.
>
> static int sp7021_spi_controller_probe(struct platform_device *pdev)
> {
> int ret;
> int mode;
> struct spi_controller *ctlr;
> struct sp7021_spi_ctlr *pspim;

This looks fine.

Attachment: signature.asc
Description: PGP signature