hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/drivers/pinctrl/pinctrl-falcon.c
....@@ -1,16 +1,13 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * linux/drivers/pinctrl/pinmux-falcon.c
34 * based on linux/drivers/pinctrl/pinmux-pxa910.c
4
- *
5
- * This program is free software; you can redistribute it and/or modify it
6
- * under the terms of the GNU General Public License version 2 as published
7
- * by the Free Software Foundation.
85 *
96 * Copyright (C) 2012 Thomas Langer <thomas.langer@lantiq.com>
107 * Copyright (C) 2012 John Crispin <john@phrozen.org>
118 */
129
13
-#include <linux/gpio.h>
10
+#include <linux/gpio/driver.h>
1411 #include <linux/interrupt.h>
1512 #include <linux/slab.h>
1613 #include <linux/export.h>
....@@ -99,12 +96,8 @@
9996 int i;
10097
10198 for (i = 0; i < len; i++) {
102
- /* strlen("ioXYZ") + 1 = 6 */
103
- char *name = kzalloc(6, GFP_KERNEL);
104
-
105
- snprintf(name, 6, "io%d", base + i);
10699 d[i].number = base + i;
107
- d[i].name = name;
100
+ d[i].name = kasprintf(GFP_KERNEL, "io%d", base + i);
108101 }
109102 pad_count[bank] = len;
110103 }
....@@ -462,12 +455,15 @@
462455 put_device(&ppdev->dev);
463456 if (IS_ERR(falcon_info.clk[*bank])) {
464457 dev_err(&ppdev->dev, "failed to get clock\n");
458
+ of_node_put(np);
465459 return PTR_ERR(falcon_info.clk[*bank]);
466460 }
467461 falcon_info.membase[*bank] = devm_ioremap_resource(&pdev->dev,
468462 &res);
469
- if (IS_ERR(falcon_info.membase[*bank]))
463
+ if (IS_ERR(falcon_info.membase[*bank])) {
464
+ of_node_put(np);
470465 return PTR_ERR(falcon_info.membase[*bank]);
466
+ }
471467
472468 avail = pad_r32(falcon_info.membase[*bank],
473469 LTQ_PADC_AVAIL);