]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
i2c: mxc: Fix dev_err being called on a nonexistant variable
authorSean Anderson <seanga2@gmail.com>
Tue, 15 Sep 2020 14:44:39 +0000 (10:44 -0400)
committerTom Rini <trini@konsulko.com>
Wed, 30 Sep 2020 12:52:30 +0000 (08:52 -0400)
The udevice we are working with is called `bus` and not `dev`.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Heiko Schocher <hs@denx.de>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>
drivers/i2c/mxc_i2c.c

index e3d980a9dfb4f4ada54fa6ce6fc6981cee6e79b5..7609594bd01467d494fa4f847e1232f1af9e87ef 100644 (file)
@@ -941,7 +941,8 @@ static int mxc_i2c_probe(struct udevice *bus)
         */
        ret = fdt_stringlist_search(fdt, node, "pinctrl-names", "gpio");
        if (ret < 0) {
-               debug("i2c bus %d at 0x%2lx, no gpio pinctrl state.\n", bus->seq, i2c_bus->base);
+               debug("i2c bus %d at 0x%2lx, no gpio pinctrl state.\n",
+                     bus->seq, i2c_bus->base);
        } else {
                ret = gpio_request_by_name_nodev(offset_to_ofnode(node),
                                "scl-gpios", 0, &i2c_bus->scl_gpio,
@@ -952,7 +953,9 @@ static int mxc_i2c_probe(struct udevice *bus)
                if (!dm_gpio_is_valid(&i2c_bus->sda_gpio) ||
                    !dm_gpio_is_valid(&i2c_bus->scl_gpio) ||
                    ret || ret2) {
-                       dev_err(dev, "i2c bus %d at %lu, fail to request scl/sda gpio\n", bus->seq, i2c_bus->base);
+                       dev_err(bus,
+                               "i2c bus %d at %lu, fail to request scl/sda gpio\n",
+                               bus->seq, i2c_bus->base);
                        return -EINVAL;
                }
        }