diff options
Diffstat (limited to 'arch/powerpc/platforms/pseries/reconfig.c')
-rw-r--r-- | arch/powerpc/platforms/pseries/reconfig.c | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/arch/powerpc/platforms/pseries/reconfig.c b/arch/powerpc/platforms/pseries/reconfig.c index 7b3bf76ef834..39f71fba9b38 100644 --- a/arch/powerpc/platforms/pseries/reconfig.c +++ b/arch/powerpc/platforms/pseries/reconfig.c | |||
@@ -432,7 +432,7 @@ static int do_update_property(char *buf, size_t bufsize) | |||
432 | unsigned char *value; | 432 | unsigned char *value; |
433 | char *name, *end, *next_prop; | 433 | char *name, *end, *next_prop; |
434 | int rc, length; | 434 | int rc, length; |
435 | struct property *newprop, *oldprop; | 435 | struct property *newprop; |
436 | buf = parse_node(buf, bufsize, &np); | 436 | buf = parse_node(buf, bufsize, &np); |
437 | end = buf + bufsize; | 437 | end = buf + bufsize; |
438 | 438 | ||
@@ -443,6 +443,9 @@ static int do_update_property(char *buf, size_t bufsize) | |||
443 | if (!next_prop) | 443 | if (!next_prop) |
444 | return -EINVAL; | 444 | return -EINVAL; |
445 | 445 | ||
446 | if (!strlen(name)) | ||
447 | return -ENODEV; | ||
448 | |||
446 | newprop = new_property(name, length, value, NULL); | 449 | newprop = new_property(name, length, value, NULL); |
447 | if (!newprop) | 450 | if (!newprop) |
448 | return -ENOMEM; | 451 | return -ENOMEM; |
@@ -450,18 +453,11 @@ static int do_update_property(char *buf, size_t bufsize) | |||
450 | if (!strcmp(name, "slb-size") || !strcmp(name, "ibm,slb-size")) | 453 | if (!strcmp(name, "slb-size") || !strcmp(name, "ibm,slb-size")) |
451 | slb_set_size(*(int *)value); | 454 | slb_set_size(*(int *)value); |
452 | 455 | ||
453 | oldprop = of_find_property(np, name,NULL); | ||
454 | if (!oldprop) { | ||
455 | if (strlen(name)) | ||
456 | return prom_add_property(np, newprop); | ||
457 | return -ENODEV; | ||
458 | } | ||
459 | |||
460 | upd_value.node = np; | 456 | upd_value.node = np; |
461 | upd_value.property = newprop; | 457 | upd_value.property = newprop; |
462 | pSeries_reconfig_notify(PSERIES_UPDATE_PROPERTY, &upd_value); | 458 | pSeries_reconfig_notify(PSERIES_UPDATE_PROPERTY, &upd_value); |
463 | 459 | ||
464 | rc = prom_update_property(np, newprop, oldprop); | 460 | rc = prom_update_property(np, newprop); |
465 | if (rc) | 461 | if (rc) |
466 | return rc; | 462 | return rc; |
467 | 463 | ||
@@ -486,7 +482,7 @@ static int do_update_property(char *buf, size_t bufsize) | |||
486 | 482 | ||
487 | rc = pSeries_reconfig_notify(action, value); | 483 | rc = pSeries_reconfig_notify(action, value); |
488 | if (rc) { | 484 | if (rc) { |
489 | prom_update_property(np, oldprop, newprop); | 485 | prom_update_property(np, newprop); |
490 | return rc; | 486 | return rc; |
491 | } | 487 | } |
492 | } | 488 | } |