| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /* |
|---|
| 2 | | - * This program is free software; you can redistribute it and/or modify it |
|---|
| 3 | | - * under the terms of the GNU General Public License version 2 as published |
|---|
| 4 | | - * by the Free Software Foundation. |
|---|
| 5 | 3 | * |
|---|
| 6 | 4 | * Copyright (C) 2013 John Crispin <john@phrozen.org> |
|---|
| 7 | 5 | */ |
|---|
| .. | .. |
|---|
| 62 | 60 | |
|---|
| 63 | 61 | pdev = of_find_device_by_node(np); |
|---|
| 64 | 62 | if (!pdev) { |
|---|
| 65 | | - pr_err("%s: failed to lookup pdev\n", np->name); |
|---|
| 63 | + pr_err("%pOFn: failed to lookup pdev\n", np); |
|---|
| 64 | + of_node_put(np); |
|---|
| 66 | 65 | return -EINVAL; |
|---|
| 67 | 66 | } |
|---|
| 68 | 67 | |
|---|
| 69 | 68 | irq = irq_of_parse_and_map(np, 0); |
|---|
| 70 | 69 | if (!irq) { |
|---|
| 71 | 70 | dev_err(&pdev->dev, "failed to get irq\n"); |
|---|
| 71 | + put_device(&pdev->dev); |
|---|
| 72 | 72 | return -EINVAL; |
|---|
| 73 | 73 | } |
|---|
| 74 | 74 | |
|---|
| 75 | 75 | if (request_irq(irq, ill_acc_irq_handler, 0, "ill_acc", &pdev->dev)) { |
|---|
| 76 | 76 | dev_err(&pdev->dev, "failed to request irq\n"); |
|---|
| 77 | + put_device(&pdev->dev); |
|---|
| 77 | 78 | return -EINVAL; |
|---|
| 78 | 79 | } |
|---|
| 79 | 80 | |
|---|