drivers: misc: nct: Remove regulator error message
Preetham Chandru [Mon, 2 Apr 2012 06:40:19 +0000 (11:40 +0530)]
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 <pchandru@nvidia.com>
Change-Id: I953d17ae14650c622e06febe415362e5cb096236
Reviewed-on: http://git-master/r/93777
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Matthew Longnecker <mlongnecker@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>

drivers/misc/nct1008.c

index 3a8aa6b..8931c8a 100644 (file)
@@ -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;
                }