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]
Message-Id: <1360933026-30325-3-git-send-email-lee.jones@linaro.org>
Date:	Fri, 15 Feb 2013 12:56:33 +0000
From:	Lee Jones <lee.jones@...aro.org>
To:	linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
	sameo@...ux.intel.com
Cc:	arnd@...db.de, linus.walleij@...ricsson.com,
	Jonas Aaberg <jonas.aberg@...ricsson.com>
Subject: [PATCH 02/35] mfd: ab8500-gpadc: Allow tvout regulator to be missing

From: Jonas Aaberg <jonas.aberg@...ricsson.com>

Signed-off-by: Jonas Aaberg <jonas.aberg@...ricsson.com>
Signed-off-by: Lee Jones <lee.jones@...aro.org
---
 drivers/mfd/ab8500-gpadc.c |   19 +++++++++++--------
 1 file changed, 11 insertions(+), 8 deletions(-)

diff --git a/drivers/mfd/ab8500-gpadc.c b/drivers/mfd/ab8500-gpadc.c
index 9ed3afc..34c1d04 100644
--- a/drivers/mfd/ab8500-gpadc.c
+++ b/drivers/mfd/ab8500-gpadc.c
@@ -140,6 +140,9 @@ struct ab8500_gpadc *ab8500_gpadc_get(char *name)
 {
 	struct ab8500_gpadc *gpadc;
 
+	if (list_empty(&ab8500_gpadc_list))
+		return NULL;
+
 	list_for_each_entry(gpadc, &ab8500_gpadc_list, node) {
 		if (!strcmp(name, dev_name(gpadc->dev)))
 		    return gpadc;
@@ -587,7 +590,8 @@ static int ab8500_gpadc_runtime_suspend(struct device *dev)
 {
 	struct ab8500_gpadc *gpadc = dev_get_drvdata(dev);
 
-	regulator_disable(gpadc->regu);
+	if (gpadc->regu)
+		regulator_disable(gpadc->regu);
 	return 0;
 }
 
@@ -595,7 +599,8 @@ static int ab8500_gpadc_runtime_resume(struct device *dev)
 {
 	struct ab8500_gpadc *gpadc = dev_get_drvdata(dev);
 
-	regulator_enable(gpadc->regu);
+	if (gpadc->regu)
+		regulator_enable(gpadc->regu);
 	return 0;
 }
 
@@ -670,9 +675,8 @@ static int ab8500_gpadc_probe(struct platform_device *pdev)
 	/* VTVout LDO used to power up ab8500-GPADC */
 	gpadc->regu = regulator_get(&pdev->dev, "vddadc");
 	if (IS_ERR(gpadc->regu)) {
-		ret = PTR_ERR(gpadc->regu);
-		dev_err(gpadc->dev, "failed to get vtvout LDO\n");
-		goto fail_irq;
+		dev_warn(gpadc->dev, "failed to get vtvout LDO\n");
+		gpadc->regu = NULL;
 	}
 
 	platform_set_drvdata(pdev, gpadc);
@@ -688,8 +692,6 @@ static int ab8500_gpadc_probe(struct platform_device *pdev)
 	list_add_tail(&gpadc->node, &ab8500_gpadc_list);
 	dev_dbg(gpadc->dev, "probe success\n");
 	return 0;
-fail_irq:
-	free_irq(gpadc->irq, gpadc);
 fail:
 	kfree(gpadc);
 	gpadc = NULL;
@@ -708,7 +710,8 @@ static int ab8500_gpadc_remove(struct platform_device *pdev)
 	pm_runtime_get_sync(gpadc->dev);
 	pm_runtime_disable(gpadc->dev);
 
-	regulator_disable(gpadc->regu);
+	if (gpadc->regu)
+		regulator_disable(gpadc->regu);
 
 	pm_runtime_set_suspended(gpadc->dev);
 
-- 
1.7.10.4

--
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