mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs.git
synced 2026-10-28 12:53:14 +01:00
spi: spi-fsl-lpspi: pass struct fsl_lpspi_data instead of struct spi_controller if possible
Instead of passing a spi_controller pointer to functions and using spi_controller_get_devdata() to get the struct fsl_lpspi_data pointer, directly pass a struct fsl_lpspi_data pointer. Signed-off-by: Marc Kleine-Budde <[email protected]> Reviewed-by: Frank Li <[email protected]> Link: https://patch.msgid.link/20261009-spi-fsl-lpspi-more-cleanups-v1-1-2d4549d5205e@pengutronix.de Signed-off-by: Mark Brown <[email protected]>
This commit is contained in:
1 parent
59eb22641f
commit
4eac392e48
1 file changed
+4
-9
@@ -550,11 +550,8 @@ static int fsl_lpspi_target_abort(struct spi_controller *controller)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int fsl_lpspi_wait_for_completion(struct spi_controller *controller)
|
||||
static int fsl_lpspi_wait_for_completion(struct fsl_lpspi_data *fsl_lpspi)
|
||||
{
|
||||
struct fsl_lpspi_data *fsl_lpspi =
|
||||
spi_controller_get_devdata(controller);
|
||||
|
||||
if (fsl_lpspi->is_target) {
|
||||
if (wait_for_completion_interruptible(&fsl_lpspi->xfer_done) ||
|
||||
fsl_lpspi->target_aborted) {
|
||||
@@ -758,11 +755,9 @@ err:
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int fsl_lpspi_pio_transfer(struct spi_controller *controller,
|
||||
static int fsl_lpspi_pio_transfer(struct fsl_lpspi_data *fsl_lpspi,
|
||||
struct spi_transfer *t)
|
||||
{
|
||||
struct fsl_lpspi_data *fsl_lpspi =
|
||||
spi_controller_get_devdata(controller);
|
||||
int ret;
|
||||
|
||||
fsl_lpspi->tx_buf = t->tx_buf;
|
||||
@@ -774,7 +769,7 @@ static int fsl_lpspi_pio_transfer(struct spi_controller *controller,
|
||||
|
||||
fsl_lpspi_write_tx_fifo(fsl_lpspi);
|
||||
|
||||
ret = fsl_lpspi_wait_for_completion(controller);
|
||||
ret = fsl_lpspi_wait_for_completion(fsl_lpspi);
|
||||
|
||||
fsl_lpspi_reset(fsl_lpspi);
|
||||
|
||||
@@ -803,7 +798,7 @@ static int fsl_lpspi_transfer_one(struct spi_controller *controller,
|
||||
if (fsl_lpspi->usedma)
|
||||
ret = fsl_lpspi_dma_transfer(controller, fsl_lpspi, t);
|
||||
else
|
||||
ret = fsl_lpspi_pio_transfer(controller, t);
|
||||
ret = fsl_lpspi_pio_transfer(fsl_lpspi, t);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
|
||||
Reference in new issue
Block a user