isp1704_charger: Set isp->dev before anything needs it
authorHeikki Krogerus <heikki.krogerus@nokia.com>
Thu, 4 Nov 2010 14:31:48 +0000 (16:31 +0200)
committerAnton Vorontsov <cbouatmailru@gmail.com>
Thu, 18 Nov 2010 13:56:20 +0000 (16:56 +0300)
isp1704_test_ulpi() is the first place that needs isp->dev
member, so it must be set before calling the function.

Signed-off-by: Heikki Krogerus <heikki.krogerus@nokia.com>
Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>
drivers/power/isp1704_charger.c

index 10c7cc5fb5f91ddef68da7855d3ff5eb5e063dd3..77c11f1d72e2b5bf0bfecfa702910f7c9430d43e 100644 (file)
@@ -391,13 +391,13 @@ static int __devinit isp1704_charger_probe(struct platform_device *pdev)
        if (!isp->otg)
                goto fail0;
 
+       isp->dev = &pdev->dev;
+       platform_set_drvdata(pdev, isp);
+
        ret = isp1704_test_ulpi(isp);
        if (ret < 0)
                goto fail1;
 
-       isp->dev = &pdev->dev;
-       platform_set_drvdata(pdev, isp);
-
        isp->psy.name           = "isp1704";
        isp->psy.type           = POWER_SUPPLY_TYPE_USB;
        isp->psy.properties     = power_props;