Skip to contentSkip to conversation

i2c: mxc_i2c: improve error message readability

PATCH Superseded ferlandm at amotus.ca 3 participants 5 messages Dec 18, 2020 – Dec 26, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 i2c: mxc_i2c: improve error message readability

From: Marc Ferland <[email protected]>

---
 drivers/i2c/mxc_i2c.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/i2c/mxc_i2c.c +1 -1
index 7609594bd0..d486dab043 100644
@@ -954,7 +954,7 @@ static int mxc_i2c_probe(struct udevice *bus)
 		    !dm_gpio_is_valid(&i2c_bus->scl_gpio) ||
 		    ret || ret2) {
 			dev_err(bus,
-				"i2c bus %d at %lu, fail to request scl/sda gpio\n",
+				"i2c bus %d at 0x%2lx, fail to request scl/sda gpio\n",
 				bus->seq, i2c_bus->base);
 			return -EINVAL;
 		}
Signature · 1 line
2.25.1
reviewer
#1 lore raw

PATCH 1/1 i2c: mxc_i2c: improve error message readability

Hi Marc,

Quoted 13 lines · On Sat, Dec 19, 2020 at 11:27 AM <[email protected]> wrote:

From: Marc Ferland <[email protected]>

---
 drivers/i2c/mxc_i2c.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/i2c/mxc_i2c.c +0 -0
index 7609594bd0..d486dab043 100644

drivers/i2c/mxc_i2c.c static int mxc_i2c_probe(struct udevice *bus) · line 957

Quoted 5 lines
drivers/i2c/mxc_i2c.c +1 -1
@@ -954,7 +954,7 @@ static int mxc_i2c_probe(struct udevice *bus)
                    !dm_gpio_is_valid(&i2c_bus->scl_gpio) ||
                    ret || ret2) {
                        dev_err(bus,
-                               "i2c bus %d at %lu, fail to request scl/sda gpio\n",
+                               "i2c bus %d at 0x%2lx, fail to request scl/sda gpio\n",

The change looks good.

I would suggest adding a commit message though.

Thanks

#2 lore raw

PATCH v2 1/1 i2c: mxc_i2c: improve error message readability

In reply to ferlandm at amotus.ca

From: Marc Ferland <[email protected]>

Use 0x%2lx to print the i2c bus base address in hexadecimal format instead of printing as an integer.

---
Changes for v2:
- Add commit message

 drivers/i2c/mxc_i2c.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/i2c/mxc_i2c.c +1 -1
index 7609594bd0..d486dab043 100644
@@ -954,7 +954,7 @@ static int mxc_i2c_probe(struct udevice *bus)
 		    !dm_gpio_is_valid(&i2c_bus->scl_gpio) ||
 		    ret || ret2) {
 			dev_err(bus,
-				"i2c bus %d at %lu, fail to request scl/sda gpio\n",
+				"i2c bus %d at 0x%2lx, fail to request scl/sda gpio\n",
 				bus->seq, i2c_bus->base);
 			return -EINVAL;
 		}
Signature · 1 line
2.25.1
#4 lore raw

PATCH v2 1/1 i2c: mxc_i2c: improve error message readability

In reply to ferlandm at amotus.ca
Quoted 5 lines

From: Marc Ferland <[email protected]>
Use 0x%2lx to print the i2c bus base address in hexadecimal format instead of printing as an integer.

Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

Signature · 5 lines
=====================================================================
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================