| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * offload engine driver for the Marvell XOR engine |
|---|
| 3 | 4 | * 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. |
|---|
| 13 | 5 | */ |
|---|
| 14 | 6 | |
|---|
| 15 | 7 | #include <linux/init.h> |
|---|
| .. | .. |
|---|
| 344 | 336 | mv_chan->dmachan.completed_cookie = cookie; |
|---|
| 345 | 337 | } |
|---|
| 346 | 338 | |
|---|
| 347 | | -static void mv_xor_tasklet(unsigned long data) |
|---|
| 339 | +static void mv_xor_tasklet(struct tasklet_struct *t) |
|---|
| 348 | 340 | { |
|---|
| 349 | | - struct mv_xor_chan *chan = (struct mv_xor_chan *) data; |
|---|
| 341 | + struct mv_xor_chan *chan = from_tasklet(chan, t, irq_tasklet); |
|---|
| 350 | 342 | |
|---|
| 351 | | - spin_lock_bh(&chan->lock); |
|---|
| 343 | + spin_lock(&chan->lock); |
|---|
| 352 | 344 | mv_chan_slot_cleanup(chan); |
|---|
| 353 | | - spin_unlock_bh(&chan->lock); |
|---|
| 345 | + spin_unlock(&chan->lock); |
|---|
| 354 | 346 | } |
|---|
| 355 | 347 | |
|---|
| 356 | 348 | static struct mv_xor_desc_slot * |
|---|
| .. | .. |
|---|
| 1105 | 1097 | |
|---|
| 1106 | 1098 | mv_chan->mmr_base = xordev->xor_base; |
|---|
| 1107 | 1099 | 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); |
|---|
| 1110 | 1101 | |
|---|
| 1111 | 1102 | /* clear errors before enabling interrupts */ |
|---|
| 1112 | 1103 | mv_chan_clear_err_status(mv_chan); |
|---|
| .. | .. |
|---|
| 1153 | 1144 | dma_has_cap(DMA_MEMCPY, dma_dev->cap_mask) ? "cpy " : "", |
|---|
| 1154 | 1145 | dma_has_cap(DMA_INTERRUPT, dma_dev->cap_mask) ? "intr " : ""); |
|---|
| 1155 | 1146 | |
|---|
| 1156 | | - dma_async_device_register(dma_dev); |
|---|
| 1147 | + ret = dma_async_device_register(dma_dev); |
|---|
| 1148 | + if (ret) |
|---|
| 1149 | + goto err_free_irq; |
|---|
| 1150 | + |
|---|
| 1157 | 1151 | return mv_chan; |
|---|
| 1158 | 1152 | |
|---|
| 1159 | 1153 | err_free_irq: |
|---|