Merge tag 'u-boot-rockchip-20200531' of https://gitlab.denx.de/u-boot/custodians...
[oweals/u-boot.git] / drivers / i2c / i2c-uniphier-f.c
index eb6c9f3d2059367b3b1aef8d2c68f29e10380f9b..d8b4a683bcedebb945d95e4e87a119d3ebabaa35 100644 (file)
@@ -1,11 +1,11 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  * Copyright (C) 2014      Panasonic Corporation
  * Copyright (C) 2015-2016 Socionext Inc.
  *   Author: Masahiro Yamada <yamada.masahiro@socionext.com>
- *
- * SPDX-License-Identifier:    GPL-2.0+
  */
 
+#include <dm/device_compat.h>
 #include <linux/errno.h>
 #include <linux/io.h>
 #include <linux/iopoll.h>
@@ -282,7 +282,7 @@ static int uniphier_fi2c_set_bus_speed(struct udevice *bus, unsigned int speed)
        struct uniphier_fi2c_regs __iomem *regs = priv->regs;
 
        /* max supported frequency is 400 kHz */
-       if (speed > 400000)
+       if (speed > I2C_SPEED_FAST_RATE)
                return -EINVAL;
 
        ret = uniphier_fi2c_check_bus_busy(priv);