aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mfd
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mfd')
-rw-r--r--drivers/mfd/lpc_ich.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/mfd/lpc_ich.c b/drivers/mfd/lpc_ich.c
index 5c2ef41fa24c..9f12f91d6296 100644
--- a/drivers/mfd/lpc_ich.c
+++ b/drivers/mfd/lpc_ich.c
@@ -916,7 +916,8 @@ static int lpc_ich_probe(struct pci_dev *dev,
916 int ret; 916 int ret;
917 bool cell_added = false; 917 bool cell_added = false;
918 918
919 priv = kmalloc(GFP_KERNEL, sizeof(struct lpc_ich_priv)); 919 priv = devm_kzalloc(&dev->dev,
920 sizeof(struct lpc_ich_priv), GFP_KERNEL);
920 if (!priv) 921 if (!priv)
921 return -ENOMEM; 922 return -ENOMEM;
922 923
@@ -952,7 +953,6 @@ static int lpc_ich_probe(struct pci_dev *dev,
952 dev_warn(&dev->dev, "No MFD cells added\n"); 953 dev_warn(&dev->dev, "No MFD cells added\n");
953 lpc_ich_restore_config_space(dev); 954 lpc_ich_restore_config_space(dev);
954 pci_set_drvdata(dev, NULL); 955 pci_set_drvdata(dev, NULL);
955 kfree(priv);
956 return -ENODEV; 956 return -ENODEV;
957 } 957 }
958 958
@@ -961,12 +961,9 @@ static int lpc_ich_probe(struct pci_dev *dev,
961 961
962static void lpc_ich_remove(struct pci_dev *dev) 962static void lpc_ich_remove(struct pci_dev *dev)
963{ 963{
964 void *priv = pci_get_drvdata(dev);
965
966 mfd_remove_devices(&dev->dev); 964 mfd_remove_devices(&dev->dev);
967 lpc_ich_restore_config_space(dev); 965 lpc_ich_restore_config_space(dev);
968 pci_set_drvdata(dev, NULL); 966 pci_set_drvdata(dev, NULL);
969 kfree(priv);
970} 967}
971 968
972static struct pci_driver lpc_ich_driver = { 969static struct pci_driver lpc_ich_driver = {