| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * linux/drivers/pinctrl/pinmux-falcon.c |
|---|
| 3 | 4 | * 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. |
|---|
| 8 | 5 | * |
|---|
| 9 | 6 | * Copyright (C) 2012 Thomas Langer <thomas.langer@lantiq.com> |
|---|
| 10 | 7 | * Copyright (C) 2012 John Crispin <john@phrozen.org> |
|---|
| 11 | 8 | */ |
|---|
| 12 | 9 | |
|---|
| 13 | | -#include <linux/gpio.h> |
|---|
| 10 | +#include <linux/gpio/driver.h> |
|---|
| 14 | 11 | #include <linux/interrupt.h> |
|---|
| 15 | 12 | #include <linux/slab.h> |
|---|
| 16 | 13 | #include <linux/export.h> |
|---|
| .. | .. |
|---|
| 99 | 96 | int i; |
|---|
| 100 | 97 | |
|---|
| 101 | 98 | 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); |
|---|
| 106 | 99 | d[i].number = base + i; |
|---|
| 107 | | - d[i].name = name; |
|---|
| 100 | + d[i].name = kasprintf(GFP_KERNEL, "io%d", base + i); |
|---|
| 108 | 101 | } |
|---|
| 109 | 102 | pad_count[bank] = len; |
|---|
| 110 | 103 | } |
|---|
| .. | .. |
|---|
| 462 | 455 | put_device(&ppdev->dev); |
|---|
| 463 | 456 | if (IS_ERR(falcon_info.clk[*bank])) { |
|---|
| 464 | 457 | dev_err(&ppdev->dev, "failed to get clock\n"); |
|---|
| 458 | + of_node_put(np); |
|---|
| 465 | 459 | return PTR_ERR(falcon_info.clk[*bank]); |
|---|
| 466 | 460 | } |
|---|
| 467 | 461 | falcon_info.membase[*bank] = devm_ioremap_resource(&pdev->dev, |
|---|
| 468 | 462 | &res); |
|---|
| 469 | | - if (IS_ERR(falcon_info.membase[*bank])) |
|---|
| 463 | + if (IS_ERR(falcon_info.membase[*bank])) { |
|---|
| 464 | + of_node_put(np); |
|---|
| 470 | 465 | return PTR_ERR(falcon_info.membase[*bank]); |
|---|
| 466 | + } |
|---|
| 471 | 467 | |
|---|
| 472 | 468 | avail = pad_r32(falcon_info.membase[*bank], |
|---|
| 473 | 469 | LTQ_PADC_AVAIL); |
|---|