Input: ads7846 - return error on regulator_get() failure
[pandora-kernel.git] / drivers / input / touchscreen / ads7846.c
index 532279c..634f6f6 100644 (file)
@@ -1163,8 +1163,8 @@ static int __devinit ads7846_probe(struct spi_device *spi)
 
        ts->reg = regulator_get(&spi->dev, "vcc");
        if (IS_ERR(ts->reg)) {
-               dev_err(&spi->dev, "unable to get regulator: %ld\n",
-                       PTR_ERR(ts->reg));
+               err = PTR_ERR(ts->reg);
+               dev_err(&spi->dev, "unable to get regulator: %ld\n", err);
                goto err_free_gpio;
        }