Skip to content

Commit

Permalink
staging: unisys: Fix clean up path
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: David Kershner <[email protected]>
Signed-off-by: Benjamin Romer <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
dzickusrh authored and gregkh committed Jun 8, 2015
1 parent 75439a1 commit 04dacac
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/staging/unisys/visorbus/visorbus_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ devmajorminor_remove_file(struct visor_device *dev, int slot)
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);
Expand Down
6 changes: 6 additions & 0 deletions drivers/staging/unisys/visorbus/visorchipset.c
Original file line number Diff line number Diff line change
Expand Up @@ -331,11 +331,16 @@ static const struct attribute_group *visorchipset_dev_groups[] = {
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 */
Expand Down Expand Up @@ -2355,6 +2360,7 @@ visorchipset_exit(struct acpi_device *acpi_device)
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;
Expand Down

0 comments on commit 04dacac

Please sign in to comment.