diff options
Diffstat (limited to 'arch/powerpc/kernel/vio.c')
-rw-r--r-- | arch/powerpc/kernel/vio.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/arch/powerpc/kernel/vio.c b/arch/powerpc/kernel/vio.c index fa3469ddaef..d692989a431 100644 --- a/arch/powerpc/kernel/vio.c +++ b/arch/powerpc/kernel/vio.c | |||
@@ -1184,7 +1184,12 @@ EXPORT_SYMBOL(vio_unregister_driver); | |||
1184 | /* vio_dev refcount hit 0 */ | 1184 | /* vio_dev refcount hit 0 */ |
1185 | static void __devinit vio_dev_release(struct device *dev) | 1185 | static void __devinit vio_dev_release(struct device *dev) |
1186 | { | 1186 | { |
1187 | /* XXX should free TCE table */ | 1187 | struct iommu_table *tbl = get_iommu_table_base(dev); |
1188 | |||
1189 | /* iSeries uses a common table for all vio devices */ | ||
1190 | if (!firmware_has_feature(FW_FEATURE_ISERIES) && tbl) | ||
1191 | iommu_free_table(tbl, dev->of_node ? | ||
1192 | dev->of_node->full_name : dev_name(dev)); | ||
1188 | of_node_put(dev->of_node); | 1193 | of_node_put(dev->of_node); |
1189 | kfree(to_vio_dev(dev)); | 1194 | kfree(to_vio_dev(dev)); |
1190 | } | 1195 | } |
@@ -1254,8 +1259,7 @@ struct vio_dev *vio_register_device_node(struct device_node *of_node) | |||
1254 | if (device_register(&viodev->dev)) { | 1259 | if (device_register(&viodev->dev)) { |
1255 | printk(KERN_ERR "%s: failed to register device %s\n", | 1260 | printk(KERN_ERR "%s: failed to register device %s\n", |
1256 | __func__, dev_name(&viodev->dev)); | 1261 | __func__, dev_name(&viodev->dev)); |
1257 | /* XXX free TCE table */ | 1262 | put_device(&viodev->dev); |
1258 | kfree(viodev); | ||
1259 | return NULL; | 1263 | return NULL; |
1260 | } | 1264 | } |
1261 | 1265 | ||