Commit c02aa89b authored by Tang Bin's avatar Tang Bin Committed by Sebastian Reichel

power: supply: axp288_charger: Use the defined variable to clean code

Use the defined variable "dev" to make the code cleaner.
Co-developed-by: default avatarZhang Shengju <zhangshengju@cmss.chinamobile.com>
Signed-off-by: default avatarZhang Shengju <zhangshengju@cmss.chinamobile.com>
Signed-off-by: default avatarTang Bin <tangbin@cmss.chinamobile.com>
Reviewed-by: default avatarHans de Goede <hdegoede@redhat.com>
Signed-off-by: default avatarSebastian Reichel <sebastian.reichel@collabora.com>
parent 6ea01266
...@@ -813,7 +813,7 @@ static int axp288_charger_probe(struct platform_device *pdev) ...@@ -813,7 +813,7 @@ static int axp288_charger_probe(struct platform_device *pdev)
if (val == 0) if (val == 0)
return -ENODEV; return -ENODEV;
info = devm_kzalloc(&pdev->dev, sizeof(*info), GFP_KERNEL); info = devm_kzalloc(dev, sizeof(*info), GFP_KERNEL);
if (!info) if (!info)
return -ENOMEM; return -ENOMEM;
...@@ -823,7 +823,7 @@ static int axp288_charger_probe(struct platform_device *pdev) ...@@ -823,7 +823,7 @@ static int axp288_charger_probe(struct platform_device *pdev)
info->cable.edev = extcon_get_extcon_dev(AXP288_EXTCON_DEV_NAME); info->cable.edev = extcon_get_extcon_dev(AXP288_EXTCON_DEV_NAME);
if (info->cable.edev == NULL) { if (info->cable.edev == NULL) {
dev_dbg(&pdev->dev, "%s is not ready, probe deferred\n", dev_dbg(dev, "%s is not ready, probe deferred\n",
AXP288_EXTCON_DEV_NAME); AXP288_EXTCON_DEV_NAME);
return -EPROBE_DEFER; return -EPROBE_DEFER;
} }
...@@ -834,8 +834,7 @@ static int axp288_charger_probe(struct platform_device *pdev) ...@@ -834,8 +834,7 @@ static int axp288_charger_probe(struct platform_device *pdev)
dev_dbg(dev, "EXTCON_USB_HOST is not ready, probe deferred\n"); dev_dbg(dev, "EXTCON_USB_HOST is not ready, probe deferred\n");
return -EPROBE_DEFER; return -EPROBE_DEFER;
} }
dev_info(&pdev->dev, dev_info(dev, "Using " USB_HOST_EXTCON_HID " extcon for usb-id\n");
"Using " USB_HOST_EXTCON_HID " extcon for usb-id\n");
} }
platform_set_drvdata(pdev, info); platform_set_drvdata(pdev, info);
...@@ -874,7 +873,7 @@ static int axp288_charger_probe(struct platform_device *pdev) ...@@ -874,7 +873,7 @@ static int axp288_charger_probe(struct platform_device *pdev)
INIT_WORK(&info->otg.work, axp288_charger_otg_evt_worker); INIT_WORK(&info->otg.work, axp288_charger_otg_evt_worker);
info->otg.id_nb.notifier_call = axp288_charger_handle_otg_evt; info->otg.id_nb.notifier_call = axp288_charger_handle_otg_evt;
if (info->otg.cable) { if (info->otg.cable) {
ret = devm_extcon_register_notifier(&pdev->dev, info->otg.cable, ret = devm_extcon_register_notifier(dev, info->otg.cable,
EXTCON_USB_HOST, &info->otg.id_nb); EXTCON_USB_HOST, &info->otg.id_nb);
if (ret) { if (ret) {
dev_err(dev, "failed to register EXTCON_USB_HOST notifier\n"); dev_err(dev, "failed to register EXTCON_USB_HOST notifier\n");
...@@ -899,7 +898,7 @@ static int axp288_charger_probe(struct platform_device *pdev) ...@@ -899,7 +898,7 @@ static int axp288_charger_probe(struct platform_device *pdev)
NULL, axp288_charger_irq_thread_handler, NULL, axp288_charger_irq_thread_handler,
IRQF_ONESHOT, info->pdev->name, info); IRQF_ONESHOT, info->pdev->name, info);
if (ret) { if (ret) {
dev_err(&pdev->dev, "failed to request interrupt=%d\n", dev_err(dev, "failed to request interrupt=%d\n",
info->irq[i]); info->irq[i]);
return ret; return ret;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment