diff options
author | Kim, Milo <Milo.Kim@ti.com> | 2013-01-03 06:30:18 +0000 |
---|---|---|
committer | Anton Vorontsov <anton@enomsg.org> | 2013-01-06 14:18:43 -0800 |
commit | d5c2b14cb2b9b6a099e22f39ae2196a8403994e9 (patch) | |
tree | 1c78820fee1ed9e146c7dbe6a2690fdc2c131b38 /drivers/power/lp8788-charger.c | |
parent | 05ac539b4fb4f7d7d0f3123c5bb81a4b34aa5327 (diff) | |
download | linux-d5c2b14cb2b9b6a099e22f39ae2196a8403994e9.tar.gz linux-d5c2b14cb2b9b6a099e22f39ae2196a8403994e9.tar.bz2 linux-d5c2b14cb2b9b6a099e22f39ae2196a8403994e9.zip |
lp8788-charger: Fix a parent device in kernel messages
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>
Diffstat (limited to 'drivers/power/lp8788-charger.c')
-rw-r--r-- | drivers/power/lp8788-charger.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/power/lp8788-charger.c b/drivers/power/lp8788-charger.c index 126a83a56640..e33d6b2a7a56 100644 --- a/drivers/power/lp8788-charger.c +++ b/drivers/power/lp8788-charger.c @@ -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; |