lkml.org 
[lkml]   [2016]   [Sep]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] regulator: da9055: remove null pointer check on array pdata->regulators
Date
From: Colin Ian King <colin.king@canonical.com>

pdata->regulators is an array of DA9052_MAX_REGULATORS struct
regulator_init_data pointers hence cannot be null, so the null pointer
check on pdata->regulators is redundant. Remove it.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
drivers/regulator/da9055-regulator.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/regulator/da9055-regulator.c b/drivers/regulator/da9055-regulator.c
index d029c94..a118f63 100644
--- a/drivers/regulator/da9055-regulator.c
+++ b/drivers/regulator/da9055-regulator.c
@@ -612,7 +612,7 @@ static int da9055_regulator_probe(struct platform_device *pdev)
config.driver_data = regulator;
config.regmap = da9055->regmap;

- if (pdata && pdata->regulators) {
+ if (pdata) {
config.init_data = pdata->regulators[pdev->id];
} else {
ret = da9055_regulator_dt_init(pdev, regulator, &config,
--
2.9.3
\
 
 \ /
  Last update: 2016-09-17 09:58    [W:0.080 / U:0.064 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site