* [PATCH] of: partition: moan if adding a partition failed
@ 2023-01-06 15:01 Ulrich Ölmann
2023-01-08 13:34 ` Alexander Shiyan
0 siblings, 1 reply; 3+ messages in thread
From: Ulrich Ölmann @ 2023-01-06 15:01 UTC (permalink / raw)
To: Barebox List
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.
Signed-off-by: Ulrich Ölmann <u.oelmann@pengutronix.de>
---
drivers/of/partition.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/of/partition.c b/drivers/of/partition.c
index abbda674d6cb..b414985555b4 100644
--- a/drivers/of/partition.c
+++ b/drivers/of/partition.c
@@ -67,8 +67,10 @@ 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;;
--
2.30.2
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] of: partition: moan if adding a partition failed
2023-01-06 15:01 [PATCH] of: partition: moan if adding a partition failed Ulrich Ölmann
@ 2023-01-08 13:34 ` Alexander Shiyan
2023-01-09 6:15 ` Ulrich Ölmann
0 siblings, 1 reply; 3+ messages in thread
From: Alexander Shiyan @ 2023-01-08 13:34 UTC (permalink / raw)
To: Ulrich Ölmann; +Cc: Barebox List
Hello.
Can you fix also double semicolon at line:
new->device_node = node;;
пт, 6 янв. 2023 г. в 18:03, Ulrich Ölmann <u.oelmann@pengutronix.de>:
>
> 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.
>
> Signed-off-by: Ulrich Ölmann <u.oelmann@pengutronix.de>
> ---
> drivers/of/partition.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/of/partition.c b/drivers/of/partition.c
> index abbda674d6cb..b414985555b4 100644
> --- a/drivers/of/partition.c
> +++ b/drivers/of/partition.c
> @@ -67,8 +67,10 @@ 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;;
> --
> 2.30.2
>
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] of: partition: moan if adding a partition failed
2023-01-08 13:34 ` Alexander Shiyan
@ 2023-01-09 6:15 ` Ulrich Ölmann
0 siblings, 0 replies; 3+ messages in thread
From: Ulrich Ölmann @ 2023-01-09 6:15 UTC (permalink / raw)
To: Alexander Shiyan; +Cc: Barebox List
Hi Alexander,
On Sun, Jan 08 2023 at 16:34 +0300, Alexander Shiyan <eagle.alexander923@gmail.com> wrote:
> Hello.
> Can you fix also double semicolon at line:
> new->device_node = node;;
just sent a v2.
Best regards
Ulrich
> пт, 6 янв. 2023 г. в 18:03, Ulrich Ölmann <u.oelmann@pengutronix.de>:
>>
>> 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.
>>
>> Signed-off-by: Ulrich Ölmann <u.oelmann@pengutronix.de>
>> ---
>> drivers/of/partition.c | 4 +++-
>> 1 file changed, 3 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/of/partition.c b/drivers/of/partition.c
>> index abbda674d6cb..b414985555b4 100644
>> --- a/drivers/of/partition.c
>> +++ b/drivers/of/partition.c
>> @@ -67,8 +67,10 @@ 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;;
>> --
>> 2.30.2
>>
>>
--
Pengutronix e.K. | Ulrich Ölmann |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-01-09 6:17 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-06 15:01 [PATCH] of: partition: moan if adding a partition failed Ulrich Ölmann
2023-01-08 13:34 ` Alexander Shiyan
2023-01-09 6:15 ` Ulrich Ölmann
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox