aboutsummaryrefslogtreecommitdiff
path: root/drivers/gpio
diff options
context:
space:
mode:
authorMasahiro Yamada2016-07-19 21:56:13 +0900
committerMasahiro Yamada2016-07-24 00:13:10 +0900
commit4e3d84066e09c9ab6cee2102db7a2c51090962a4 (patch)
treea563f3c3f0f0ef2426ef96157fbb628f41c47851 /drivers/gpio
parent72a64348ef937daaca0553e9d8d75b5774555e57 (diff)
ARM: uniphier: use (devm_)ioremap() instead of map_sysmem()
This does not have much impact on behavior, but makes code look more more like Linux. The use of devm_ioremap() often helps to delete .remove callbacks entirely. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Diffstat (limited to 'drivers/gpio')
-rw-r--r--drivers/gpio/gpio-uniphier.c16
1 files changed, 3 insertions, 13 deletions
diff --git a/drivers/gpio/gpio-uniphier.c b/drivers/gpio/gpio-uniphier.c
index bde51eab15b..afb27a396ff 100644
--- a/drivers/gpio/gpio-uniphier.c
+++ b/drivers/gpio/gpio-uniphier.c
@@ -1,12 +1,12 @@
/*
- * Copyright (C) 2016 Masahiro Yamada <yamada.masahiro@socionext.com>
+ * Copyright (C) 2016 Socionext Inc.
+ * Author: Masahiro Yamada <yamada.masahiro@socionext.com>
*
* SPDX-License-Identifier: GPL-2.0+
*/
#include <common.h>
#include <dm/device.h>
-#include <mapmem.h>
#include <linux/bitops.h>
#include <linux/io.h>
#include <linux/sizes.h>
@@ -99,7 +99,7 @@ static int uniphier_gpio_probe(struct udevice *dev)
if (addr == FDT_ADDR_T_NONE)
return -EINVAL;
- priv->base = map_sysmem(addr, SZ_8);
+ priv->base = devm_ioremap(dev, addr, SZ_8);
if (!priv->base)
return -ENOMEM;
@@ -119,15 +119,6 @@ static int uniphier_gpio_probe(struct udevice *dev)
return 0;
}
-static int uniphier_gpio_remove(struct udevice *dev)
-{
- struct uniphier_gpio_priv *priv = dev_get_priv(dev);
-
- unmap_sysmem(priv->base);
-
- return 0;
-}
-
/* .data = the number of GPIO banks */
static const struct udevice_id uniphier_gpio_match[] = {
{ .compatible = "socionext,uniphier-gpio" },
@@ -139,7 +130,6 @@ U_BOOT_DRIVER(uniphier_gpio) = {
.id = UCLASS_GPIO,
.of_match = uniphier_gpio_match,
.probe = uniphier_gpio_probe,
- .remove = uniphier_gpio_remove,
.priv_auto_alloc_size = sizeof(struct uniphier_gpio_priv),
.ops = &uniphier_gpio_ops,
};