From 9f4174ca7cf958a64654c8aeee8029f8ff3935e8 Mon Sep 17 00:00:00 2001 From: Preetham Chandru Date: Mon, 2 Apr 2012 12:10:19 +0530 Subject: drivers: misc: nct: Remove regulator error message Print only a warning message if vdd regulator is not registered. Some board do not have a seperate vdd regulator and hence print only a warning message in such cases. Bug 961258 Signed-off-by: Preetham Chandru R Change-Id: I953d17ae14650c622e06febe415362e5cb096236 Reviewed-on: http://git-master/r/93777 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Matthew Longnecker Reviewed-by: Bharat Nihalani --- drivers/misc/nct1008.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'drivers/misc') diff --git a/drivers/misc/nct1008.c b/drivers/misc/nct1008.c index 3a8aa6b9dbd2..8931c8a673e5 100644 --- a/drivers/misc/nct1008.c +++ b/drivers/misc/nct1008.c @@ -545,10 +545,14 @@ static void nct1008_power_control(struct nct1008_data *data, bool is_enable) if (!data->nct_reg) { data->nct_reg = regulator_get(&data->client->dev, "vdd"); if (IS_ERR_OR_NULL(data->nct_reg)) { - dev_warn(&data->client->dev, "Error [%d] in" - "getting the regulator handle for vdd " - "of %s\n", (int)data->nct_reg, - dev_name(&data->client->dev)); + if (PTR_ERR(data->nct_reg) == -ENODEV) + dev_info(&data->client->dev, + "no regulator found for vdd." + " Assuming vdd is always powered"); + else + dev_warn(&data->client->dev, "Error [%ld] in " + "getting the regulator handle for" + " vdd\n", PTR_ERR(data->nct_reg)); data->nct_reg = NULL; return; } -- cgit v1.2.3