Skip to content

Commit 4c17ca2

Browse files
committed
Merge tag 'spi-fix-v5.15-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi
Pull spi fixes from Mark BrownL "This contains a couple of fixes, one fix for handling of zero length transfers on Rockchip devices and a warning fix which will conflict with a version you did but cleans up some extra unneeded forward declarations as well which seems a bit neater" * tag 'spi-fix-v5.15-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi: spi: tegra20-slink: Declare runtime suspend and resume functions conditionally spi: rockchip: handle zero length transfers without timing out
2 parents 2ff59ba + 2bab940 commit 4c17ca2

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

drivers/spi/spi-rockchip.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -600,6 +600,12 @@ static int rockchip_spi_transfer_one(
600600
int ret;
601601
bool use_dma;
602602

603+
/* Zero length transfers won't trigger an interrupt on completion */
604+
if (!xfer->len) {
605+
spi_finalize_current_transfer(ctlr);
606+
return 1;
607+
}
608+
603609
WARN_ON(readl_relaxed(rs->regs + ROCKCHIP_SPI_SSIENR) &&
604610
(readl_relaxed(rs->regs + ROCKCHIP_SPI_SR) & SR_BUSY));
605611

drivers/spi/spi-tegra20-slink.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -204,9 +204,6 @@ struct tegra_slink_data {
204204
struct dma_async_tx_descriptor *tx_dma_desc;
205205
};
206206

207-
static int tegra_slink_runtime_suspend(struct device *dev);
208-
static int tegra_slink_runtime_resume(struct device *dev);
209-
210207
static inline u32 tegra_slink_readl(struct tegra_slink_data *tspi,
211208
unsigned long reg)
212209
{
@@ -1185,7 +1182,8 @@ static int tegra_slink_resume(struct device *dev)
11851182
}
11861183
#endif
11871184

1188-
static int __maybe_unused tegra_slink_runtime_suspend(struct device *dev)
1185+
#ifdef CONFIG_PM
1186+
static int tegra_slink_runtime_suspend(struct device *dev)
11891187
{
11901188
struct spi_master *master = dev_get_drvdata(dev);
11911189
struct tegra_slink_data *tspi = spi_master_get_devdata(master);
@@ -1197,7 +1195,7 @@ static int __maybe_unused tegra_slink_runtime_suspend(struct device *dev)
11971195
return 0;
11981196
}
11991197

1200-
static int __maybe_unused tegra_slink_runtime_resume(struct device *dev)
1198+
static int tegra_slink_runtime_resume(struct device *dev)
12011199
{
12021200
struct spi_master *master = dev_get_drvdata(dev);
12031201
struct tegra_slink_data *tspi = spi_master_get_devdata(master);
@@ -1210,6 +1208,7 @@ static int __maybe_unused tegra_slink_runtime_resume(struct device *dev)
12101208
}
12111209
return 0;
12121210
}
1211+
#endif /* CONFIG_PM */
12131212

12141213
static const struct dev_pm_ops slink_pm_ops = {
12151214
SET_RUNTIME_PM_OPS(tegra_slink_runtime_suspend,

0 commit comments

Comments
 (0)