From: Kim, Milo Date: Thu, 3 Jan 2013 06:30:18 +0000 (+0000) Subject: lp8788-charger: Fix a parent device in kernel messages X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=d5c2b14cb2b9b6a099e22f39ae2196a8403994e9;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git 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 Signed-off-by: Anton Vorontsov --- 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;