diff options
| author | Johan Hovold <johan@kernel.org> | 2026-03-12 18:18:15 +0300 |
|---|---|---|
| committer | Mark Brown <broonie@kernel.org> | 2026-03-16 21:36:04 +0300 |
| commit | d5b4cb41b9a244e5571f9a589e77cc38ac5ebcc3 (patch) | |
| tree | e644928c8e29f221b558b9cbe9203521a04aeb97 | |
| parent | dee0774bbb2abb172e9069ce5ffef579b12b3ae9 (diff) | |
| download | linux-d5b4cb41b9a244e5571f9a589e77cc38ac5ebcc3.tar.xz | |
spi: drop unused devres statistics allocation
Drop the now unused device managed per-cpu statistics allocation.
Signed-off-by: Johan Hovold <johan@kernel.org>
Link: https://patch.msgid.link/20260312151817.32100-4-johan@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
| -rw-r--r-- | drivers/spi/spi.c | 27 |
1 files changed, 12 insertions, 15 deletions
diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c index 53dee314d76a..bfc42b75549a 100644 --- a/drivers/spi/spi.c +++ b/drivers/spi/spi.c @@ -96,25 +96,22 @@ static ssize_t driver_override_show(struct device *dev, } static DEVICE_ATTR_RW(driver_override); -static struct spi_statistics __percpu *spi_alloc_pcpu_stats(struct device *dev) +static struct spi_statistics __percpu *spi_alloc_pcpu_stats(void) { struct spi_statistics __percpu *pcpu_stats; + int cpu; - if (dev) - pcpu_stats = devm_alloc_percpu(dev, struct spi_statistics); - else - pcpu_stats = alloc_percpu_gfp(struct spi_statistics, GFP_KERNEL); - - if (pcpu_stats) { - int cpu; + pcpu_stats = alloc_percpu_gfp(struct spi_statistics, GFP_KERNEL); + if (!pcpu_stats) + return NULL; - for_each_possible_cpu(cpu) { - struct spi_statistics *stat; + for_each_possible_cpu(cpu) { + struct spi_statistics *stat; - stat = per_cpu_ptr(pcpu_stats, cpu); - u64_stats_init(&stat->syncp); - } + stat = per_cpu_ptr(pcpu_stats, cpu); + u64_stats_init(&stat->syncp); } + return pcpu_stats; } @@ -574,7 +571,7 @@ struct spi_device *spi_alloc_device(struct spi_controller *ctlr) return NULL; } - spi->pcpu_statistics = spi_alloc_pcpu_stats(NULL); + spi->pcpu_statistics = spi_alloc_pcpu_stats(); if (!spi->pcpu_statistics) { kfree(spi); spi_controller_put(ctlr); @@ -3194,7 +3191,7 @@ struct spi_controller *__spi_alloc_controller(struct device *dev, if (!ctlr) return NULL; - ctlr->pcpu_statistics = spi_alloc_pcpu_stats(NULL); + ctlr->pcpu_statistics = spi_alloc_pcpu_stats(); if (!ctlr->pcpu_statistics) { kfree(ctlr); return NULL; |
