i2c: mux: pca954x: correct PTR_ERR for regulator
Mayuresh Kulkarni [Mon, 23 Apr 2012 12:34:45 +0000 (17:34 +0530)]
- 3.4 kernel core for regulator returns EPROBE_DEFER
for regulator_get() instead of ENODEV
- this driver was using ENODEV causing its probe fail

Bug 974063
Bug 974078

Change-Id: Ibf8a6b63c67c084e615c3516144f556c06a34dd7
Signed-off-by: Mayuresh Kulkarni <mkulkarni@nvidia.com>
Reviewed-on: http://git-master/r/98203
Reviewed-by: Pritesh Raithatha <praithatha@nvidia.com>
Reviewed-by: Varun Wadekar <vwadekar@nvidia.com>

drivers/i2c/muxes/pca954x.c

index 0961fe3..9c173c4 100644 (file)
@@ -237,7 +237,7 @@ static int pca954x_probe(struct i2c_client *client,
 
        /* Get regulator pointer for pca954x vcc */
        data->vcc_reg = regulator_get(&client->dev, "vcc");
-       if (PTR_ERR(data->vcc_reg) == -ENODEV)
+       if (PTR_ERR(data->vcc_reg) == -EPROBE_DEFER)
                data->vcc_reg = NULL;
        else if (IS_ERR(data->vcc_reg)) {
                dev_err(&client->dev, "%s: failed to get vcc\n",
@@ -247,7 +247,7 @@ static int pca954x_probe(struct i2c_client *client,
        }
        /* Get regulator pointer for pca954x vcc_i2c */
        data->i2c_reg = regulator_get(&client->dev, "vcc_i2c");
-       if (PTR_ERR(data->i2c_reg) == -ENODEV)
+       if (PTR_ERR(data->i2c_reg) == -EPROBE_DEFER)
                data->i2c_reg = NULL;
        else if (IS_ERR(data->i2c_reg)) {
                dev_err(&client->dev, "%s: failed to get vcc_i2c\n",