lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 30 Oct 2014 12:36:45 +0100
From:	Antoine Tenart <antoine.tenart@...e-electrons.com>
To:	Peter.Chen@...escale.com
Cc:	Antoine Tenart <antoine.tenart@...e-electrons.com>,
	alexandre.belloni@...e-electrons.com,
	thomas.petazzoni@...e-electrons.com, zmxu@...vell.com,
	jszhang@...vell.com, linux-usb@...r.kernel.org,
	linux-kernel@...r.kernel.org
Subject: [PATCH 4/6] usb: chipidea: use ci_hdrc_get_platdata in ci_hdrc_pci

Use the newly introduced ci_hdrc_get_platdata function to help setup the
chipidea internal ci_hdrc_platform_data structure.

Signed-off-by: Antoine Tenart <antoine.tenart@...e-electrons.com>
---
 drivers/usb/chipidea/ci_hdrc_pci.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/drivers/usb/chipidea/ci_hdrc_pci.c b/drivers/usb/chipidea/ci_hdrc_pci.c
index 241ae3444fde..d2ffc651b650 100644
--- a/drivers/usb/chipidea/ci_hdrc_pci.c
+++ b/drivers/usb/chipidea/ci_hdrc_pci.c
@@ -51,16 +51,22 @@ static struct ci_hdrc_platform_data penwell_pci_platdata = {
 static int ci_hdrc_pci_probe(struct pci_dev *pdev,
 				       const struct pci_device_id *id)
 {
-	struct ci_hdrc_platform_data *platdata = (void *)id->driver_data;
+	struct ci_hdrc_platform_data *ci_pdata_default =
+			(void *)id->driver_data;
+	struct ci_hdrc_platform_data *ci_pdata;
 	struct platform_device *plat_ci;
 	struct resource res[3];
 	int retval = 0, nres = 2;
 
-	if (!platdata) {
+	if (!ci_pdata_default) {
 		dev_err(&pdev->dev, "device doesn't provide driver data\n");
 		return -ENODEV;
 	}
 
+	ci_pdata = ci_hdrc_get_platdata(&pdev->dev, ci_pdata_default);
+	if (IS_ERR(ci_pdata))
+		return PTR_ERR(ci_pdata);
+
 	retval = pcim_enable_device(pdev);
 	if (retval)
 		return retval;
@@ -80,7 +86,7 @@ static int ci_hdrc_pci_probe(struct pci_dev *pdev,
 	res[1].start	= pdev->irq;
 	res[1].flags	= IORESOURCE_IRQ;
 
-	plat_ci = ci_hdrc_add_device(&pdev->dev, res, nres, platdata);
+	plat_ci = ci_hdrc_add_device(&pdev->dev, res, nres, ci_pdata);
 	if (IS_ERR(plat_ci)) {
 		dev_err(&pdev->dev, "ci_hdrc_add_device failed!\n");
 		return PTR_ERR(plat_ci);
-- 
2.1.0

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ