.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
---|
1 | 2 | /* |
---|
2 | 3 | * linux/drivers/pinctrl/pinmux-xway.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 |
---|
6 | | - * it under the terms of the GNU General Public License version 2 as |
---|
7 | | - * publishhed by the Free Software Foundation. |
---|
8 | 5 | * |
---|
9 | 6 | * Copyright (C) 2012 John Crispin <john@phrozen.org> |
---|
10 | 7 | * Copyright (C) 2015 Martin Schiller <mschiller@tdt.de> |
---|
.. | .. |
---|
1708 | 1705 | { |
---|
1709 | 1706 | const struct of_device_id *match; |
---|
1710 | 1707 | const struct pinctrl_xway_soc *xway_soc; |
---|
1711 | | - struct resource *res; |
---|
1712 | 1708 | int ret, i; |
---|
1713 | 1709 | |
---|
1714 | 1710 | /* get and remap our register range */ |
---|
1715 | | - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
---|
1716 | | - xway_info.membase[0] = devm_ioremap_resource(&pdev->dev, res); |
---|
| 1711 | + xway_info.membase[0] = devm_platform_ioremap_resource(pdev, 0); |
---|
1717 | 1712 | if (IS_ERR(xway_info.membase[0])) |
---|
1718 | 1713 | return PTR_ERR(xway_info.membase[0]); |
---|
1719 | 1714 | |
---|
.. | .. |
---|
1734 | 1729 | return -ENOMEM; |
---|
1735 | 1730 | |
---|
1736 | 1731 | for (i = 0; i < xway_chip.ngpio; i++) { |
---|
1737 | | - /* strlen("ioXY") + 1 = 5 */ |
---|
1738 | | - char *name = devm_kzalloc(&pdev->dev, 5, GFP_KERNEL); |
---|
| 1732 | + char *name = devm_kasprintf(&pdev->dev, GFP_KERNEL, "io%d", i); |
---|
1739 | 1733 | |
---|
1740 | 1734 | if (!name) |
---|
1741 | 1735 | return -ENOMEM; |
---|
1742 | 1736 | |
---|
1743 | | - snprintf(name, 5, "io%d", i); |
---|
1744 | 1737 | xway_info.pads[i].number = GPIO0 + i; |
---|
1745 | 1738 | xway_info.pads[i].name = name; |
---|
1746 | 1739 | } |
---|