When unloading a module, we need to cleanup the platform registration.
However, unregistering the platform uncovered a couple of quirks, namely
a missing device_release function. Fix things up so module unload works
and allows us to reload the module.
Signed-off-by: Don Zickus <dzickus@redhat.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
if (slot < 0 || slot >= maxdevnodes)
return;
myattr = (struct devmajorminor_attribute *)(dev->devnodes[slot].attr);
- if (myattr)
+ if (!myattr)
return;
sysfs_remove_file(&dev->kobjdevmajorminor, &myattr->attr);
kobject_uevent(&dev->device.kobj, KOBJ_OFFLINE);
NULL
};
+static void visorchipset_dev_release(struct device *dev)
+{
+}
+
/* /sys/devices/platform/visorchipset */
static struct platform_device visorchipset_platform_device = {
.name = "visorchipset",
.id = -1,
.dev.groups = visorchipset_dev_groups,
+ .dev.release = visorchipset_dev_release,
};
/* Function prototypes */
visorchannel_destroy(controlvm_channel);
visorchipset_file_cleanup(visorchipset_platform_device.dev.devt);
+ platform_device_unregister(&visorchipset_platform_device);
POSTCODE_LINUX_2(DRIVER_EXIT_PC, POSTCODE_SEVERITY_INFO);
return 0;