mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH v2] of: partition: moan if adding a partition failed
@ 2023-01-09  6:14 Ulrich Ölmann
  2023-01-09  9:08 ` Sascha Hauer
  0 siblings, 1 reply; 2+ messages in thread
From: Ulrich Ölmann @ 2023-01-09  6:14 UTC (permalink / raw)
  To: Barebox List; +Cc: Alexander Shiyan

Do not silently continue if e.g. the label of a partition defined in the
devicetree collides with the name of a partition defined in a GPT on the device.

While already at it, fix a double semicolon a few lines downward.

Signed-off-by: Ulrich Ölmann <u.oelmann@pengutronix.de>
---
 drivers/of/partition.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/of/partition.c b/drivers/of/partition.c
index abbda674d6cb..ed1114193062 100644
--- a/drivers/of/partition.c
+++ b/drivers/of/partition.c
@@ -67,11 +67,13 @@ struct cdev *of_parse_partition(struct cdev *cdev, struct device_node *node)
 	filename = basprintf("%s.%s", cdev->name, partname);
 
 	new = devfs_add_partition(cdev->name, offset, size, flags, filename);
-	if (IS_ERR(new))
+	if (IS_ERR(new)) {
+		pr_err("Adding partition %s failed: %pe\n", filename, new);
 		new = NULL;
+	}
 
 	if (new)
-		new->device_node = node;;
+		new->device_node = node;
 
 	if (IS_ENABLED(CONFIG_NVMEM) && of_device_is_compatible(node, "nvmem-cells")) {
 		struct nvmem_device *nvmem = nvmem_partition_register(new);
-- 
2.30.2




^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH v2] of: partition: moan if adding a partition failed
  2023-01-09  6:14 [PATCH v2] of: partition: moan if adding a partition failed Ulrich Ölmann
@ 2023-01-09  9:08 ` Sascha Hauer
  0 siblings, 0 replies; 2+ messages in thread
From: Sascha Hauer @ 2023-01-09  9:08 UTC (permalink / raw)
  To: Ulrich Ölmann; +Cc: Barebox List, Alexander Shiyan

On Mon, Jan 09, 2023 at 07:14:01AM +0100, Ulrich Ölmann wrote:
> Do not silently continue if e.g. the label of a partition defined in the
> devicetree collides with the name of a partition defined in a GPT on the device.
> 
> While already at it, fix a double semicolon a few lines downward.
> 
> Signed-off-by: Ulrich Ölmann <u.oelmann@pengutronix.de>
> ---
>  drivers/of/partition.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)

Applied, thanks

Sascha

> 
> diff --git a/drivers/of/partition.c b/drivers/of/partition.c
> index abbda674d6cb..ed1114193062 100644
> --- a/drivers/of/partition.c
> +++ b/drivers/of/partition.c
> @@ -67,11 +67,13 @@ struct cdev *of_parse_partition(struct cdev *cdev, struct device_node *node)
>  	filename = basprintf("%s.%s", cdev->name, partname);
>  
>  	new = devfs_add_partition(cdev->name, offset, size, flags, filename);
> -	if (IS_ERR(new))
> +	if (IS_ERR(new)) {
> +		pr_err("Adding partition %s failed: %pe\n", filename, new);
>  		new = NULL;
> +	}
>  
>  	if (new)
> -		new->device_node = node;;
> +		new->device_node = node;
>  
>  	if (IS_ENABLED(CONFIG_NVMEM) && of_device_is_compatible(node, "nvmem-cells")) {
>  		struct nvmem_device *nvmem = nvmem_partition_register(new);
> -- 
> 2.30.2
> 
> 
> 

-- 
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 |



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-01-09  9:10 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-09  6:14 [PATCH v2] of: partition: moan if adding a partition failed Ulrich Ölmann
2023-01-09  9:08 ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox