diff options
author | Akinobu Mita <akinobu.mita@gmail.com> | 2011-06-20 23:35:56 -0400 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2011-06-29 03:48:24 -0400 |
commit | de2780a3d82372a6bfc7f474905e346c0f26dfa4 (patch) | |
tree | f9a50e6dadeeacfad6d6c8f266d98662679b5dd0 /arch/powerpc/kernel/prom.c | |
parent | 3aef19f0a10d1c274a15191766b627fe550d456e (diff) |
powerpc/pseries: Improve error code on reconfiguration notifier failure
Reconfiguration notifier call for device node may fail by several reasons,
but it always assumes kmalloc failures.
This enables reconfiguration notifier call chain to get the actual error
code rather than -ENOMEM by converting all reconfiguration notifier calls
to return encapsulate error code with notifier_from_errno().
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: linuxppc-dev@lists.ozlabs.org
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/kernel/prom.c')
-rw-r--r-- | arch/powerpc/kernel/prom.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c index 534c50359e06..b8e6189298f4 100644 --- a/arch/powerpc/kernel/prom.c +++ b/arch/powerpc/kernel/prom.c | |||
@@ -849,16 +849,14 @@ static int prom_reconfig_notifier(struct notifier_block *nb, | |||
849 | switch (action) { | 849 | switch (action) { |
850 | case PSERIES_RECONFIG_ADD: | 850 | case PSERIES_RECONFIG_ADD: |
851 | err = of_finish_dynamic_node(node); | 851 | err = of_finish_dynamic_node(node); |
852 | if (err < 0) { | 852 | if (err < 0) |
853 | printk(KERN_ERR "finish_node returned %d\n", err); | 853 | printk(KERN_ERR "finish_node returned %d\n", err); |
854 | err = NOTIFY_BAD; | ||
855 | } | ||
856 | break; | 854 | break; |
857 | default: | 855 | default: |
858 | err = NOTIFY_DONE; | 856 | err = 0; |
859 | break; | 857 | break; |
860 | } | 858 | } |
861 | return err; | 859 | return notifier_from_errno(err); |
862 | } | 860 | } |
863 | 861 | ||
864 | static struct notifier_block prom_reconfig_nb = { | 862 | static struct notifier_block prom_reconfig_nb = { |