diff options
author | Matthew Wilcox <matthew@wil.cx> | 2006-10-04 15:37:41 -0400 |
---|---|---|
committer | Matthew Wilcox <willy@hera.kernel.org> | 2006-10-04 21:48:18 -0400 |
commit | 1070c9655b90016ec4c9b59c402292e57ee15885 (patch) | |
tree | 01024599b8d4f37839dae0d18b8a2d2c71dadb2c /arch | |
parent | f64ef295032d07345ca26bf4876a1577c4dccb37 (diff) |
[PA-RISC] Fix must_check warnings in drivers.c
Panic if we can't register the parisc bus or the root parisc device.
There's no way we can boot without them, so let the user know ASAP.
If we can't register a parisc device, handle the failure gracefully.
Signed-off-by: Matthew Wilcox <willy@parisc-linux.org>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/parisc/kernel/drivers.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/arch/parisc/kernel/drivers.c b/arch/parisc/kernel/drivers.c index 3d569a485a1a..2b257e4f17df 100644 --- a/arch/parisc/kernel/drivers.c +++ b/arch/parisc/kernel/drivers.c | |||
@@ -424,7 +424,10 @@ struct parisc_device * create_tree_node(char id, struct device *parent) | |||
424 | /* make the generic dma mask a pointer to the parisc one */ | 424 | /* make the generic dma mask a pointer to the parisc one */ |
425 | dev->dev.dma_mask = &dev->dma_mask; | 425 | dev->dev.dma_mask = &dev->dma_mask; |
426 | dev->dev.coherent_dma_mask = dev->dma_mask; | 426 | dev->dev.coherent_dma_mask = dev->dma_mask; |
427 | device_register(&dev->dev); | 427 | if (!device_register(&dev->dev)) { |
428 | kfree(dev); | ||
429 | return NULL; | ||
430 | } | ||
428 | 431 | ||
429 | return dev; | 432 | return dev; |
430 | } | 433 | } |
@@ -850,8 +853,10 @@ static void print_parisc_device(struct parisc_device *dev) | |||
850 | */ | 853 | */ |
851 | void init_parisc_bus(void) | 854 | void init_parisc_bus(void) |
852 | { | 855 | { |
853 | bus_register(&parisc_bus_type); | 856 | if (!bus_register(&parisc_bus_type)) |
854 | device_register(&root); | 857 | panic("Could not register PA-RISC bus type\n"); |
858 | if (!device_register(&root)) | ||
859 | panic("Could not register PA-RISC root device\n"); | ||
855 | get_device(&root); | 860 | get_device(&root); |
856 | } | 861 | } |
857 | 862 | ||