Re: [PATCH] Platform lockdown information in SYSFS

From: Greg Kroah-Hartman
Date: Tue Aug 04 2020 - 12:42:30 EST


On Tue, Aug 04, 2020 at 11:37:02AM -0300, Daniel Gutson wrote:
> static void mypci_remove(struct pci_dev *pdev)
> {
> /*
> I tried enabling and disabling this
> if (child_device != NULL) {
> put_device(child_device);
> device_unregister(child_device);
> }
> */

You can just call device_destroy() here, but this should be the same.

But, if you have it commented out, that's not good, you have to clean
this up.

> class_remove_file(&my_class, &class_attr_howareyou);

You don't always have to remove files you create, but it doesn't hurt.

> class_unregister(&my_class);

class_destroy()? But this is the same as well, so all is good.

Try running without the above code commented out.

greg k-h