aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/misc/mei/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/misc/mei/main.c')
-rw-r--r--drivers/misc/mei/main.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/drivers/misc/mei/main.c b/drivers/misc/mei/main.c
index 872de9d1494b..329fb865cfd0 100644
--- a/drivers/misc/mei/main.c
+++ b/drivers/misc/mei/main.c
@@ -753,15 +753,25 @@ static struct miscdevice mei_misc_device = {
753 .minor = MISC_DYNAMIC_MINOR, 753 .minor = MISC_DYNAMIC_MINOR,
754}; 754};
755 755
756int mei_register(struct device *dev) 756
757int mei_register(struct mei_device *dev)
757{ 758{
758 mei_misc_device.parent = dev; 759 int ret;
759 return misc_register(&mei_misc_device); 760 mei_misc_device.parent = &dev->pdev->dev;
761 ret = misc_register(&mei_misc_device);
762 if (ret)
763 return ret;
764
765 if (mei_dbgfs_register(dev, mei_misc_device.name))
766 dev_err(&dev->pdev->dev, "cannot register debugfs\n");
767
768 return 0;
760} 769}
761EXPORT_SYMBOL_GPL(mei_register); 770EXPORT_SYMBOL_GPL(mei_register);
762 771
763void mei_deregister(void) 772void mei_deregister(struct mei_device *dev)
764{ 773{
774 mei_dbgfs_deregister(dev);
765 misc_deregister(&mei_misc_device); 775 misc_deregister(&mei_misc_device);
766 mei_misc_device.parent = NULL; 776 mei_misc_device.parent = NULL;
767} 777}