power: supply: da9150: Remove redundant error logging
A call to platform_get_irq_byname() already prints an error on failure within its own implementation. So printing another error based on its return value in the caller is redundant and should be removed. The clean up also makes if condition block braces and the device pointer variable dev unnecessary. Remove those as well. Issue identified using platform_get_irq.cocci coccinelle semantic patch. Signed-off-by: Deepak R Varma <drv@mailo.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
This commit is contained in:
Родитель
a441f3b90a
Коммит
5dd482688a
|
@ -466,10 +466,8 @@ static int da9150_charger_register_irq(struct platform_device *pdev,
|
|||
int irq, ret;
|
||||
|
||||
irq = platform_get_irq_byname(pdev, irq_name);
|
||||
if (irq < 0) {
|
||||
dev_err(dev, "Failed to get IRQ CHG_STATUS: %d\n", irq);
|
||||
if (irq < 0)
|
||||
return irq;
|
||||
}
|
||||
|
||||
ret = request_threaded_irq(irq, NULL, handler, IRQF_ONESHOT, irq_name,
|
||||
charger);
|
||||
|
@ -482,15 +480,12 @@ static int da9150_charger_register_irq(struct platform_device *pdev,
|
|||
static void da9150_charger_unregister_irq(struct platform_device *pdev,
|
||||
const char *irq_name)
|
||||
{
|
||||
struct device *dev = &pdev->dev;
|
||||
struct da9150_charger *charger = platform_get_drvdata(pdev);
|
||||
int irq;
|
||||
|
||||
irq = platform_get_irq_byname(pdev, irq_name);
|
||||
if (irq < 0) {
|
||||
dev_err(dev, "Failed to get IRQ CHG_STATUS: %d\n", irq);
|
||||
if (irq < 0)
|
||||
return;
|
||||
}
|
||||
|
||||
free_irq(irq, charger);
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче