Commit f34d67febf374055af71fdcc1f90f49a91ebfea7

Authored by Hisashi Nakamura
Committed by Greg Kroah-Hartman
1 parent e8ff14951e

spi: sh-msiof: Add runtime PM lock in initializing

commit 015760563ec77bf17cec712fa94afdf53b285287 upstream.

SH-MSIOF driver is enabled autosuspend API of spi framework.
But autosuspend framework doesn't work during initializing.
So runtime PM lock is added in SH-MSIOF driver initializing.

Fixes: e2a0ba547ba31c (spi: sh-msiof: Convert to spi core auto_runtime_pm framework)
Signed-off-by: Hisashi Nakamura <hisashi.nakamura.ak@renesas.com>
Signed-off-by: Yoshihiro Kaneko <ykaneko0929@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Showing 1 changed file with 5 additions and 0 deletions Side-by-side Diff

drivers/spi/spi-sh-msiof.c
... ... @@ -480,6 +480,8 @@
480 480 struct device_node *np = spi->master->dev.of_node;
481 481 struct sh_msiof_spi_priv *p = spi_master_get_devdata(spi->master);
482 482  
  483 + pm_runtime_get_sync(&p->pdev->dev);
  484 +
483 485 if (!np) {
484 486 /*
485 487 * Use spi->controller_data for CS (same strategy as spi_gpio),
... ... @@ -497,6 +499,9 @@
497 499  
498 500 if (spi->cs_gpio >= 0)
499 501 gpio_set_value(spi->cs_gpio, !(spi->mode & SPI_CS_HIGH));
  502 +
  503 +
  504 + pm_runtime_put_sync(&p->pdev->dev);
500 505  
501 506 return 0;
502 507 }