.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
---|
1 | 2 | /* |
---|
2 | 3 | * RapidIO interconnect services |
---|
3 | 4 | * (RapidIO Interconnect Specification, http://www.rapidio.org) |
---|
.. | .. |
---|
7 | 8 | * |
---|
8 | 9 | * Copyright 2009 - 2013 Integrated Device Technology, Inc. |
---|
9 | 10 | * Alex Bounine <alexandre.bounine@idt.com> |
---|
10 | | - * |
---|
11 | | - * This program is free software; you can redistribute it and/or modify it |
---|
12 | | - * under the terms of the GNU General Public License as published by the |
---|
13 | | - * Free Software Foundation; either version 2 of the License, or (at your |
---|
14 | | - * option) any later version. |
---|
15 | 11 | */ |
---|
16 | 12 | |
---|
17 | 13 | #include <linux/types.h> |
---|
.. | .. |
---|
2271 | 2267 | atomic_set(&port->state, RIO_DEVICE_RUNNING); |
---|
2272 | 2268 | |
---|
2273 | 2269 | res = device_register(&port->dev); |
---|
2274 | | - if (res) |
---|
| 2270 | + if (res) { |
---|
2275 | 2271 | dev_err(&port->dev, "RIO: mport%d registration failed ERR=%d\n", |
---|
2276 | 2272 | port->id, res); |
---|
2277 | | - else |
---|
| 2273 | + mutex_lock(&rio_mport_list_lock); |
---|
| 2274 | + list_del(&port->node); |
---|
| 2275 | + mutex_unlock(&rio_mport_list_lock); |
---|
| 2276 | + put_device(&port->dev); |
---|
| 2277 | + } else { |
---|
2278 | 2278 | dev_dbg(&port->dev, "RIO: registered mport%d\n", port->id); |
---|
| 2279 | + } |
---|
2279 | 2280 | |
---|
2280 | 2281 | return res; |
---|
2281 | 2282 | } |
---|