summaryrefslogtreecommitdiff
path: root/drivers/i2c/i2c-uniphier-f.c
diff options
context:
space:
mode:
authorMasahiro Yamada <yamada.masahiro@socionext.com>2016-07-19 12:56:13 (GMT)
committerMasahiro Yamada <yamada.masahiro@socionext.com>2016-07-23 15:13:10 (GMT)
commit4e3d84066e09c9ab6cee2102db7a2c51090962a4 (patch)
treea563f3c3f0f0ef2426ef96157fbb628f41c47851 /drivers/i2c/i2c-uniphier-f.c
parent72a64348ef937daaca0553e9d8d75b5774555e57 (diff)
downloadu-boot-fsl-qoriq-4e3d84066e09c9ab6cee2102db7a2c51090962a4.tar.xz
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/i2c/i2c-uniphier-f.c')
-rw-r--r--drivers/i2c/i2c-uniphier-f.c17
1 files changed, 4 insertions, 13 deletions
diff --git a/drivers/i2c/i2c-uniphier-f.c b/drivers/i2c/i2c-uniphier-f.c
index aebdcfc..a56e058 100644
--- a/drivers/i2c/i2c-uniphier-f.c
+++ b/drivers/i2c/i2c-uniphier-f.c
@@ -1,5 +1,7 @@
/*
- * Copyright (C) 2014-2015 Masahiro Yamada <yamada.masahiro@socionext.com>
+ * Copyright (C) 2014 Panasonic Corporation
+ * Copyright (C) 2015-2016 Socionext Inc.
+ * Author: Masahiro Yamada <yamada.masahiro@socionext.com>
*
* SPDX-License-Identifier: GPL-2.0+
*/
@@ -13,7 +15,6 @@
#include <dm/root.h>
#include <i2c.h>
#include <fdtdec.h>
-#include <mapmem.h>
struct uniphier_fi2c_regs {
u32 cr; /* control register */
@@ -118,7 +119,7 @@ static int uniphier_fi2c_probe(struct udevice *dev)
if (addr == FDT_ADDR_T_NONE)
return -EINVAL;
- priv->regs = map_sysmem(addr, SZ_128);
+ priv->regs = devm_ioremap(dev, addr, SZ_128);
if (!priv->regs)
return -ENOMEM;
@@ -134,15 +135,6 @@ static int uniphier_fi2c_probe(struct udevice *dev)
return 0;
}
-static int uniphier_fi2c_remove(struct udevice *dev)
-{
- struct uniphier_fi2c_dev *priv = dev_get_priv(dev);
-
- unmap_sysmem(priv->regs);
-
- return 0;
-}
-
static int wait_for_irq(struct uniphier_fi2c_dev *dev, u32 flags,
bool *stop)
{
@@ -359,7 +351,6 @@ U_BOOT_DRIVER(uniphier_fi2c) = {
.id = UCLASS_I2C,
.of_match = uniphier_fi2c_of_match,
.probe = uniphier_fi2c_probe,
- .remove = uniphier_fi2c_remove,
.priv_auto_alloc_size = sizeof(struct uniphier_fi2c_dev),
.ops = &uniphier_fi2c_ops,
};