}
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;
}
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);
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;