misc: nct1008: fixing regulator handling
venu byravarasu [Mon, 26 Sep 2011 07:55:55 +0000 (12:55 +0530)]
Corrected regulator handling of NCT1008

bug 869217

Reviewed-on: http://git-master/r/51296
(cherry picked from commit 6b39c9f51b3c09c6aa0b1cd7e7a3fdb122200d14)

Change-Id: Ibae0c651322e9191942a1be8f544916f7333d967
Reviewed-on: http://git-master/r/54224
Tested-by: Venu Byravarasu <vbyravarasu@nvidia.com>
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>

Rebase-Id: R942722fef526eda21b1296ecefb17b08f29ad44f

drivers/misc/nct1008.c

index ef157c3..5cc8974 100644 (file)
@@ -549,10 +549,11 @@ static void nct1008_power_control(struct nct1008_data *data, bool is_enable)
 {
        int ret;
        if (!data->nct_reg) {
-               data->nct_reg = regulator_get(NULL, "vdd_nct1008");
+               data->nct_reg = regulator_get(data->client->dev, "vdd");
                if (IS_ERR_OR_NULL(data->nct_reg)) {
-                       dev_warn(&data->client->dev, "Error in getting the "
-                               "regulator handle for vdd_nct1008\n");
+                       dev_warn(&data->client->dev, "Error [%d] in"
+                               "getting the regulator handle for vdd of %s\n",
+                               data->nct_reg, dev_name(data->client->dev));
                        data->nct_reg = NULL;
                        return;
                }