lp8788-charger: Fix a parent device in kernel messages
authorKim, Milo <Milo.Kim@ti.com>
Thu, 3 Jan 2013 06:30:18 +0000 (06:30 +0000)
committerAnton Vorontsov <anton@enomsg.org>
Sun, 6 Jan 2013 22:18:43 +0000 (14:18 -0800)
Use 'platform_device' in kernel messages rather than i2c client device
node. lp8788_update_charger_params() needs additional argument, 'pdev'.
Then, remove unnecessary lp8788 private data in lp8788_irq_register().

Signed-off-by: Milo(Woogyom) Kim <milo.kim@ti.com>
Signed-off-by: Anton Vorontsov <anton@enomsg.org>
drivers/power/lp8788-charger.c

index 126a83a56640b9aca30c2b531656d8982ba8d98c..e33d6b2a7a56eb0a5dd968b1b28506aca55868f8 100644 (file)
@@ -367,7 +367,8 @@ static inline bool lp8788_is_valid_charger_register(u8 addr)
        return addr >= LP8788_CHG_START && addr <= LP8788_CHG_END;
 }
 
-static int lp8788_update_charger_params(struct lp8788_charger *pchg)
+static int lp8788_update_charger_params(struct platform_device *pdev,
+                                       struct lp8788_charger *pchg)
 {
        struct lp8788 *lp = pchg->lp;
        struct lp8788_charger_platform_data *pdata = pchg->pdata;
@@ -376,7 +377,7 @@ static int lp8788_update_charger_params(struct lp8788_charger *pchg)
        int ret;
 
        if (!pdata || !pdata->chg_params) {
-               dev_info(lp->dev, "skip updating charger parameters\n");
+               dev_info(&pdev->dev, "skip updating charger parameters\n");
                return 0;
        }
 
@@ -537,7 +538,6 @@ err_free_irq:
 static int lp8788_irq_register(struct platform_device *pdev,
                                struct lp8788_charger *pchg)
 {
-       struct lp8788 *lp = pchg->lp;
        const char *name[] = {
                LP8788_CHG_IRQ, LP8788_PRSW_IRQ, LP8788_BATT_IRQ
        };
@@ -550,13 +550,13 @@ static int lp8788_irq_register(struct platform_device *pdev,
        for (i = 0; i < ARRAY_SIZE(name); i++) {
                ret = lp8788_set_irqs(pdev, pchg, name[i]);
                if (ret) {
-                       dev_warn(lp->dev, "irq setup failed: %s\n", name[i]);
+                       dev_warn(&pdev->dev, "irq setup failed: %s\n", name[i]);
                        return ret;
                }
        }
 
        if (pchg->num_irqs > LP8788_MAX_CHG_IRQS) {
-               dev_err(lp->dev, "invalid total number of irqs: %d\n",
+               dev_err(&pdev->dev, "invalid total number of irqs: %d\n",
                        pchg->num_irqs);
                return -EINVAL;
        }
@@ -701,7 +701,7 @@ static int lp8788_charger_probe(struct platform_device *pdev)
        pchg->pdata = lp->pdata ? lp->pdata->chg_pdata : NULL;
        platform_set_drvdata(pdev, pchg);
 
-       ret = lp8788_update_charger_params(pchg);
+       ret = lp8788_update_charger_params(pdev, pchg);
        if (ret)
                return ret;