Skip to contentSkip to conversation

sparc: Remove corresponding sysfs file on device remove

PATCH New James Clarke 1 participant 1 message May 29, 2017 SPARC + UltraSPARC (sparc/sparc64)

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 sparc: Remove corresponding sysfs file on device remove

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id2541

---
 arch/sparc/kernel/vio.c | 6 ++++++
 1 file changed, 6 insertions(+)
arch/sparc/kernel/vio.c +6 -0
index f6bb857254fc..4da8db27fbf2 100644
@@ -368,9 +368,15 @@ static void vio_remove(struct mdesc_handle *hp, u64 node)
 	dev = device_find_child(&root_vdev->dev, (void *) node,
 				vio_md_node_match);
 	if (dev) {
+		struct vio_dev *vdev = to_vio_dev(dev);
+
 		printk(KERN_INFO "VIO: Removing device %s\n", dev_name(dev));
 
 		device_unregister(dev);
+		if (vdev->dp)
+			sysfs_remove_file(&vdev->dev.kobj,
+					  &dev_attr_obppath.attr);
+
 		put_device(dev);
 	}
 }
Signature · 1 line
2.11.0