diff options
author | Joerg Roedel <jroedel@suse.de> | 2015-05-28 12:41:45 -0400 |
---|---|---|
committer | Joerg Roedel <jroedel@suse.de> | 2015-06-11 03:42:24 -0400 |
commit | 3a18404cd952ae529651f72a13e5d6ffee824c2e (patch) | |
tree | f79fa73b3d88281a5525f96954fae14da93ee945 | |
parent | 2870b0a4911038fd6aed9093cda2dbe80fd0ee2e (diff) |
iommu/amd: Propagate errors from amd_iommu_init_api
This function can fail. Propagate any errors back to the
initialization state machine.
Signed-off-by: Joerg Roedel <jroedel@suse.de>
-rw-r--r-- | drivers/iommu/amd_iommu.c | 4 | ||||
-rw-r--r-- | drivers/iommu/amd_iommu_init.c | 5 | ||||
-rw-r--r-- | drivers/iommu/amd_iommu_proto.h | 2 |
3 files changed, 6 insertions, 5 deletions
diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c index 96390b9b7842..8bc6f40edf5e 100644 --- a/drivers/iommu/amd_iommu.c +++ b/drivers/iommu/amd_iommu.c | |||
@@ -2840,9 +2840,9 @@ static struct dma_map_ops amd_iommu_dma_ops = { | |||
2840 | .dma_supported = amd_iommu_dma_supported, | 2840 | .dma_supported = amd_iommu_dma_supported, |
2841 | }; | 2841 | }; |
2842 | 2842 | ||
2843 | void __init amd_iommu_init_api(void) | 2843 | int __init amd_iommu_init_api(void) |
2844 | { | 2844 | { |
2845 | bus_set_iommu(&pci_bus_type, &amd_iommu_ops); | 2845 | return bus_set_iommu(&pci_bus_type, &amd_iommu_ops); |
2846 | } | 2846 | } |
2847 | 2847 | ||
2848 | int __init amd_iommu_init_dma_ops(void) | 2848 | int __init amd_iommu_init_dma_ops(void) |
diff --git a/drivers/iommu/amd_iommu_init.c b/drivers/iommu/amd_iommu_init.c index e4a6e405e35d..dbac49cea7a1 100644 --- a/drivers/iommu/amd_iommu_init.c +++ b/drivers/iommu/amd_iommu_init.c | |||
@@ -1391,9 +1391,10 @@ static int __init amd_iommu_init_pci(void) | |||
1391 | for_each_iommu(iommu) | 1391 | for_each_iommu(iommu) |
1392 | iommu_flush_all_caches(iommu); | 1392 | iommu_flush_all_caches(iommu); |
1393 | 1393 | ||
1394 | amd_iommu_init_api(); | 1394 | ret = amd_iommu_init_api(); |
1395 | 1395 | ||
1396 | print_iommu_info(); | 1396 | if (!ret) |
1397 | print_iommu_info(); | ||
1397 | 1398 | ||
1398 | return ret; | 1399 | return ret; |
1399 | } | 1400 | } |
diff --git a/drivers/iommu/amd_iommu_proto.h b/drivers/iommu/amd_iommu_proto.h index 72b0fd455e24..9ed1c4330551 100644 --- a/drivers/iommu/amd_iommu_proto.h +++ b/drivers/iommu/amd_iommu_proto.h | |||
@@ -30,7 +30,7 @@ extern void amd_iommu_reset_cmd_buffer(struct amd_iommu *iommu); | |||
30 | extern int amd_iommu_init_devices(void); | 30 | extern int amd_iommu_init_devices(void); |
31 | extern void amd_iommu_uninit_devices(void); | 31 | extern void amd_iommu_uninit_devices(void); |
32 | extern void amd_iommu_init_notifier(void); | 32 | extern void amd_iommu_init_notifier(void); |
33 | extern void amd_iommu_init_api(void); | 33 | extern int amd_iommu_init_api(void); |
34 | 34 | ||
35 | /* Needed for interrupt remapping */ | 35 | /* Needed for interrupt remapping */ |
36 | extern int amd_iommu_prepare(void); | 36 | extern int amd_iommu_prepare(void); |