| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Sony MemoryStick support |
|---|
| 3 | 4 | * |
|---|
| 4 | 5 | * Copyright (C) 2007 Alex Dubov <oakad@yahoo.com> |
|---|
| 5 | 6 | * |
|---|
| 6 | | - * This program is free software; you can redistribute it and/or modify |
|---|
| 7 | | - * it under the terms of the GNU General Public License version 2 as |
|---|
| 8 | | - * published by the Free Software Foundation. |
|---|
| 9 | | - * |
|---|
| 10 | 7 | * Special thanks to Carlos Corbacho for providing various MemoryStick cards |
|---|
| 11 | 8 | * that made this driver possible. |
|---|
| 12 | | - * |
|---|
| 13 | 9 | */ |
|---|
| 14 | 10 | |
|---|
| 15 | 11 | #include <linux/memstick.h> |
|---|
| .. | .. |
|---|
| 445 | 441 | } else if (host->card->stop) |
|---|
| 446 | 442 | host->card->stop(host->card); |
|---|
| 447 | 443 | |
|---|
| 444 | + if (host->removing) |
|---|
| 445 | + goto out_power_off; |
|---|
| 446 | + |
|---|
| 448 | 447 | card = memstick_alloc_card(host); |
|---|
| 449 | 448 | |
|---|
| 450 | 449 | if (!card) { |
|---|
| .. | .. |
|---|
| 548 | 547 | */ |
|---|
| 549 | 548 | void memstick_remove_host(struct memstick_host *host) |
|---|
| 550 | 549 | { |
|---|
| 550 | + host->removing = 1; |
|---|
| 551 | 551 | flush_workqueue(workqueue); |
|---|
| 552 | 552 | mutex_lock(&host->lock); |
|---|
| 553 | 553 | if (host->card) |
|---|