|
|
@@ -294,6 +294,18 @@ static void irq_sysfs_add(int irq, struct irq_desc *desc)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+static void irq_sysfs_del(struct irq_desc *desc)
|
|
|
+{
|
|
|
+ /*
|
|
|
+ * If irq_sysfs_init() has not yet been invoked (early boot), then
|
|
|
+ * irq_kobj_base is NULL and the descriptor was never added.
|
|
|
+ * kobject_del() complains about a object with no parent, so make
|
|
|
+ * it conditional.
|
|
|
+ */
|
|
|
+ if (irq_kobj_base)
|
|
|
+ kobject_del(&desc->kobj);
|
|
|
+}
|
|
|
+
|
|
|
static int __init irq_sysfs_init(void)
|
|
|
{
|
|
|
struct irq_desc *desc;
|
|
|
@@ -324,6 +336,7 @@ static struct kobj_type irq_kobj_type = {
|
|
|
};
|
|
|
|
|
|
static void irq_sysfs_add(int irq, struct irq_desc *desc) {}
|
|
|
+static void irq_sysfs_del(struct irq_desc *desc) {}
|
|
|
|
|
|
#endif /* CONFIG_SYSFS */
|
|
|
|
|
|
@@ -437,7 +450,7 @@ static void free_desc(unsigned int irq)
|
|
|
* The sysfs entry must be serialized against a concurrent
|
|
|
* irq_sysfs_init() as well.
|
|
|
*/
|
|
|
- kobject_del(&desc->kobj);
|
|
|
+ irq_sysfs_del(desc);
|
|
|
delete_irq_desc(irq);
|
|
|
|
|
|
/*
|