Skip to contentSkip to conversation

state: helpful error message if state GUID cannot be found

PATCH Applied Enrico Jörns 3 participants 3 messages Jan 13

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 state: helpful error message if state GUID cannot be found

So far, if the user didn't specify a valid GPT UID, state initialization failed with the not so helpful error message:

| ERROR: state state.of: probe failed: Invalid argument

Improve this by also providing a helpful error message.

---
 common/state/state.c | 1 +
 1 file changed, 1 insertion(+)
common/state/state.c +1 -0
index ac6cd6e572..1c23ad4c80 100644
@@ -649,6 +649,7 @@ struct state *state_new_from_node(struct device_node *node, bool readonly)
 	if (cdev_is_block_disk(cdev)) {
 		cdev = cdev_find_child_by_gpt_typeuuid(cdev, &barebox_state_partition_guid);
 		if (IS_ERR(cdev)) {
+			dev_err(&state->dev, "cannot find backend GPT partition by PartitionTypeGUID\n");
 			ret = -EINVAL;
 			goto out_release_state;
 		}
Signature · 1 line
2.47.3
Reviewed-by on v1 1/1
#1 lore raw

Hello,

Quoted 8 lines · Enrico Jörns

So far, if the user didn't specify a valid GPT UID, state initialization failed with the not so helpful error message:

| ERROR: state state.of: probe failed: Invalid argument

Improve this by also providing a helpful error message.

Thanks,
Ahmad

Quoted 16 lines
---
 common/state/state.c | 1 +
 1 file changed, 1 insertion(+)
common/state/state.c +1 -0
index ac6cd6e572..1c23ad4c80 100644
@@ -649,6 +649,7 @@ struct state *state_new_from_node(struct device_node *node, bool readonly)
 	if (cdev_is_block_disk(cdev)) {
 		cdev = cdev_find_child_by_gpt_typeuuid(cdev, &barebox_state_partition_guid);
 		if (IS_ERR(cdev)) {
+			dev_err(&state->dev, "cannot find backend GPT partition by PartitionTypeGUID\n");
 			ret = -EINVAL;
 			goto out_release_state;
 		}
Signature · 4 lines
Pengutronix e.K.                  |                             |
Steuerwalder Str. 21              | http://www.pengutronix.de/  |
31137 Hildesheim, Germany         | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686  | Fax:   +49-5121-206917-5555 |
Applied
#2 lore raw
In reply to Enrico Jörns
Quoted 8 lines · Enrico Jörns

So far, if the user didn't specify a valid GPT UID, state initialization failed with the not so helpful error message:

| ERROR: state state.of: probe failed: Invalid argument

Improve this by also providing a helpful error message.

[...]

Applied, thanks!

[1/1] state: helpful error message if state GUID cannot be found
https://git.pengutronix.de/cgit/barebox/commit/?id=20333bd90ce3 (link may not be stable)

Best regards,

Signature · 1 line
Sascha Hauer <[email protected]>