| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Low Level Transport (NDLC) Driver for STMicroelectronics NFC Chip |
|---|
| 3 | 4 | * |
|---|
| 4 | 5 | * Copyright (C) 2014-2015 STMicroelectronics SAS. All rights reserved. |
|---|
| 5 | | - * |
|---|
| 6 | | - * This program is free software; you can redistribute it and/or modify it |
|---|
| 7 | | - * under the terms and conditions of the GNU General Public License, |
|---|
| 8 | | - * version 2, as published by the Free Software Foundation. |
|---|
| 9 | | - * |
|---|
| 10 | | - * This program is distributed in the hope that it will be useful, |
|---|
| 11 | | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|---|
| 12 | | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|---|
| 13 | | - * GNU General Public License for more details. |
|---|
| 14 | | - * |
|---|
| 15 | | - * You should have received a copy of the GNU General Public License |
|---|
| 16 | | - * along with this program; if not, see <http://www.gnu.org/licenses/>. |
|---|
| 17 | 6 | */ |
|---|
| 18 | 7 | |
|---|
| 19 | 8 | #include <linux/sched.h> |
|---|
| .. | .. |
|---|
| 297 | 286 | |
|---|
| 298 | 287 | void ndlc_remove(struct llt_ndlc *ndlc) |
|---|
| 299 | 288 | { |
|---|
| 300 | | - st_nci_remove(ndlc->ndev); |
|---|
| 301 | | - |
|---|
| 302 | 289 | /* cancel timers */ |
|---|
| 303 | 290 | del_timer_sync(&ndlc->t1_timer); |
|---|
| 304 | 291 | del_timer_sync(&ndlc->t2_timer); |
|---|
| 305 | 292 | ndlc->t2_active = false; |
|---|
| 306 | 293 | ndlc->t1_active = false; |
|---|
| 294 | + /* cancel work */ |
|---|
| 295 | + cancel_work_sync(&ndlc->sm_work); |
|---|
| 296 | + |
|---|
| 297 | + st_nci_remove(ndlc->ndev); |
|---|
| 307 | 298 | |
|---|
| 308 | 299 | skb_queue_purge(&ndlc->rcv_q); |
|---|
| 309 | 300 | skb_queue_purge(&ndlc->send_q); |
|---|