forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-05-10 cde9070d9970eef1f7ec2360586c802a16230ad8
kernel/drivers/isdn/mISDN/core.c
....@@ -1,15 +1,6 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * Copyright 2008 by Karsten Keil <kkeil@novell.com>
3
- *
4
- * This program is free software; you can redistribute it and/or modify
5
- * it under the terms of the GNU General Public License version 2 as
6
- * published by the Free Software Foundation.
7
- *
8
- * This program is distributed in the hope that it will be useful,
9
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
10
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
- * GNU General Public License for more details.
12
- *
134 */
145
156 #include <linux/slab.h>
....@@ -231,7 +222,7 @@
231222
232223 err = get_free_devid();
233224 if (err < 0)
234
- goto error1;
225
+ return err;
235226 dev->id = err;
236227
237228 device_initialize(&dev->dev);
....@@ -242,11 +233,12 @@
242233 if (debug & DEBUG_CORE)
243234 printk(KERN_DEBUG "mISDN_register %s %d\n",
244235 dev_name(&dev->dev), dev->id);
236
+ dev->dev.class = &mISDN_class;
237
+
245238 err = create_stack(dev);
246239 if (err)
247240 goto error1;
248241
249
- dev->dev.class = &mISDN_class;
250242 dev->dev.platform_data = dev;
251243 dev->dev.parent = parent;
252244 dev_set_drvdata(&dev->dev, dev);
....@@ -258,8 +250,8 @@
258250
259251 error3:
260252 delete_stack(dev);
261
- return err;
262253 error1:
254
+ put_device(&dev->dev);
263255 return err;
264256
265257 }