* [PATCH] regulator: s5m8767: Check pdata->buck[2|3|4]_gpiodvs earlier
@ 2012-03-10 0:43 Axel Lin
2012-03-14 4:32 ` Sangbeom Kim
2012-03-14 14:10 ` Mark Brown
0 siblings, 2 replies; 3+ messages in thread
From: Axel Lin @ 2012-03-10 0:43 UTC (permalink / raw)
To: linux-kernel; +Cc: Sangbeom Kim, Liam Girdwood, Mark Brown
If we need to ensure only one of the buck[2|3|4]_gpiodvs can be specificed,
check them earlier.
Signed-off-by: Axel Lin <axel.lin@gmail.com>
---
drivers/regulator/s5m8767.c | 45 ++++++++++++++++++++----------------------
1 files changed, 21 insertions(+), 24 deletions(-)
diff --git a/drivers/regulator/s5m8767.c b/drivers/regulator/s5m8767.c
index e369d9e..f1514f1 100644
--- a/drivers/regulator/s5m8767.c
+++ b/drivers/regulator/s5m8767.c
@@ -549,6 +549,27 @@ static __devinit int s5m8767_pmic_probe(struct platform_device *pdev)
return -ENODEV;
}
+ if (pdata->buck2_gpiodvs) {
+ if (pdata->buck3_gpiodvs || pdata->buck4_gpiodvs) {
+ dev_err(&pdev->dev, "S5M8767 GPIO DVS NOT VALID\n");
+ return -EINVAL;
+ }
+ }
+
+ if (pdata->buck3_gpiodvs) {
+ if (pdata->buck2_gpiodvs || pdata->buck4_gpiodvs) {
+ dev_err(&pdev->dev, "S5M8767 GPIO DVS NOT VALID\n");
+ return -EINVAL;
+ }
+ }
+
+ if (pdata->buck4_gpiodvs) {
+ if (pdata->buck2_gpiodvs || pdata->buck3_gpiodvs) {
+ dev_err(&pdev->dev, "S5M8767 GPIO DVS NOT VALID\n");
+ return -EINVAL;
+ }
+ }
+
s5m8767 = devm_kzalloc(&pdev->dev, sizeof(struct s5m8767_info),
GFP_KERNEL);
if (!s5m8767)
@@ -642,30 +663,6 @@ static __devinit int s5m8767_pmic_probe(struct platform_device *pdev)
}
}
- if (pdata->buck2_gpiodvs) {
- if (pdata->buck3_gpiodvs || pdata->buck4_gpiodvs) {
- dev_err(&pdev->dev, "S5M8767 GPIO DVS NOT VALID\n");
- ret = -EINVAL;
- return ret;
- }
- }
-
- if (pdata->buck3_gpiodvs) {
- if (pdata->buck2_gpiodvs || pdata->buck4_gpiodvs) {
- dev_err(&pdev->dev, "S5M8767 GPIO DVS NOT VALID\n");
- ret = -EINVAL;
- return ret;
- }
- }
-
- if (pdata->buck4_gpiodvs) {
- if (pdata->buck2_gpiodvs || pdata->buck3_gpiodvs) {
- dev_err(&pdev->dev, "S5M8767 GPIO DVS NOT VALID\n");
- ret = -EINVAL;
- return ret;
- }
- }
-
s5m_reg_update(s5m8767->iodev, S5M8767_REG_BUCK2CTRL,
(pdata->buck2_gpiodvs) ? (1 << 1) : (0 << 1), 1 << 1);
s5m_reg_update(s5m8767->iodev, S5M8767_REG_BUCK3CTRL,
--
1.7.5.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* RE: [PATCH] regulator: s5m8767: Check pdata->buck[2|3|4]_gpiodvs earlier
2012-03-10 0:43 [PATCH] regulator: s5m8767: Check pdata->buck[2|3|4]_gpiodvs earlier Axel Lin
@ 2012-03-14 4:32 ` Sangbeom Kim
2012-03-14 14:10 ` Mark Brown
1 sibling, 0 replies; 3+ messages in thread
From: Sangbeom Kim @ 2012-03-14 4:32 UTC (permalink / raw)
To: 'Axel Lin', linux-kernel
Cc: 'Liam Girdwood', 'Mark Brown'
Hi,
On Saturday, 2012-03-010 at 9:43 AM, Axel Lin wrote:
> If we need to ensure only one of the buck[2|3|4]_gpiodvs can be specificed,
> check them earlier.
Acked-by: Sangbeom Kim <sbkim73@samsung.com>
Sangbeom.
Thanks,
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] regulator: s5m8767: Check pdata->buck[2|3|4]_gpiodvs earlier
2012-03-10 0:43 [PATCH] regulator: s5m8767: Check pdata->buck[2|3|4]_gpiodvs earlier Axel Lin
2012-03-14 4:32 ` Sangbeom Kim
@ 2012-03-14 14:10 ` Mark Brown
1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2012-03-14 14:10 UTC (permalink / raw)
To: Axel Lin; +Cc: linux-kernel, Sangbeom Kim, Liam Girdwood
[-- Attachment #1: Type: text/plain, Size: 176 bytes --]
On Sat, Mar 10, 2012 at 08:43:02AM +0800, Axel Lin wrote:
> If we need to ensure only one of the buck[2|3|4]_gpiodvs can be specificed,
> check them earlier.
Applied, thanks.
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2012-03-14 14:10 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-10 0:43 [PATCH] regulator: s5m8767: Check pdata->buck[2|3|4]_gpiodvs earlier Axel Lin
2012-03-14 4:32 ` Sangbeom Kim
2012-03-14 14:10 ` Mark Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox