hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/drivers/dma/mv_xor.c
....@@ -1,15 +1,7 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * offload engine driver for the Marvell XOR engine
34 * Copyright (C) 2007, 2008, Marvell International Ltd.
4
- *
5
- * This program is free software; you can redistribute it and/or modify it
6
- * under the terms and conditions of the GNU General Public License,
7
- * version 2, as published by the Free Software Foundation.
8
- *
9
- * This program is distributed in the hope it will be useful, but WITHOUT
10
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12
- * more details.
135 */
146
157 #include <linux/init.h>
....@@ -344,13 +336,13 @@
344336 mv_chan->dmachan.completed_cookie = cookie;
345337 }
346338
347
-static void mv_xor_tasklet(unsigned long data)
339
+static void mv_xor_tasklet(struct tasklet_struct *t)
348340 {
349
- struct mv_xor_chan *chan = (struct mv_xor_chan *) data;
341
+ struct mv_xor_chan *chan = from_tasklet(chan, t, irq_tasklet);
350342
351
- spin_lock_bh(&chan->lock);
343
+ spin_lock(&chan->lock);
352344 mv_chan_slot_cleanup(chan);
353
- spin_unlock_bh(&chan->lock);
345
+ spin_unlock(&chan->lock);
354346 }
355347
356348 static struct mv_xor_desc_slot *
....@@ -1105,8 +1097,7 @@
11051097
11061098 mv_chan->mmr_base = xordev->xor_base;
11071099 mv_chan->mmr_high_base = xordev->xor_high_base;
1108
- tasklet_init(&mv_chan->irq_tasklet, mv_xor_tasklet, (unsigned long)
1109
- mv_chan);
1100
+ tasklet_setup(&mv_chan->irq_tasklet, mv_xor_tasklet);
11101101
11111102 /* clear errors before enabling interrupts */
11121103 mv_chan_clear_err_status(mv_chan);
....@@ -1153,7 +1144,10 @@
11531144 dma_has_cap(DMA_MEMCPY, dma_dev->cap_mask) ? "cpy " : "",
11541145 dma_has_cap(DMA_INTERRUPT, dma_dev->cap_mask) ? "intr " : "");
11551146
1156
- dma_async_device_register(dma_dev);
1147
+ ret = dma_async_device_register(dma_dev);
1148
+ if (ret)
1149
+ goto err_free_irq;
1150
+
11571151 return mv_chan;
11581152
11591153 err_free_irq: