hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/drivers/rapidio/rio.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * RapidIO interconnect services
34 * (RapidIO Interconnect Specification, http://www.rapidio.org)
....@@ -7,11 +8,6 @@
78 *
89 * Copyright 2009 - 2013 Integrated Device Technology, Inc.
910 * 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.
1511 */
1612
1713 #include <linux/types.h>
....@@ -2271,11 +2267,16 @@
22712267 atomic_set(&port->state, RIO_DEVICE_RUNNING);
22722268
22732269 res = device_register(&port->dev);
2274
- if (res)
2270
+ if (res) {
22752271 dev_err(&port->dev, "RIO: mport%d registration failed ERR=%d\n",
22762272 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 {
22782278 dev_dbg(&port->dev, "RIO: registered mport%d\n", port->id);
2279
+ }
22792280
22802281 return res;
22812282 }