Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ff7109fa authored by Aaron Sierra's avatar Aaron Sierra Committed by Samuel Ortiz
Browse files

mfd: lpc_ich: Use devres API to allocate private data



And fix a kzalloc argument inversion bug while converting to devres.

Signed-off-by: default avatarAaron Sierra <asierra@xes-inc.com>
Signed-off-by: default avatarSamuel Ortiz <sameo@linux.intel.com>
parent 3ec3090c
Loading
Loading
Loading
Loading
+2 −5
Original line number Diff line number Diff line
@@ -916,7 +916,8 @@ static int lpc_ich_probe(struct pci_dev *dev,
	int ret;
	bool cell_added = false;

	priv = kmalloc(GFP_KERNEL, sizeof(struct lpc_ich_priv));
	priv = devm_kzalloc(&dev->dev,
			    sizeof(struct lpc_ich_priv), GFP_KERNEL);
	if (!priv)
		return -ENOMEM;

@@ -952,7 +953,6 @@ static int lpc_ich_probe(struct pci_dev *dev,
		dev_warn(&dev->dev, "No MFD cells added\n");
		lpc_ich_restore_config_space(dev);
		pci_set_drvdata(dev, NULL);
		kfree(priv);
		return -ENODEV;
	}

@@ -961,12 +961,9 @@ static int lpc_ich_probe(struct pci_dev *dev,

static void lpc_ich_remove(struct pci_dev *dev)
{
	void *priv = pci_get_drvdata(dev);

	mfd_remove_devices(&dev->dev);
	lpc_ich_restore_config_space(dev);
	pci_set_drvdata(dev, NULL);
	kfree(priv);
}

static struct pci_driver lpc_ich_driver = {