| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Compaq iPAQ h3xxx Atmel microcontroller companion support |
|---|
| 3 | 4 | * |
|---|
| .. | .. |
|---|
| 8 | 9 | * Author : Alessandro Gardich <gremlin@gremlin.it> |
|---|
| 9 | 10 | * Author : Dmitry Artamonow <mad_soft@inbox.ru> |
|---|
| 10 | 11 | * Author : Linus Walleij <linus.walleij@linaro.org> |
|---|
| 11 | | - * |
|---|
| 12 | | - * This program is free software; you can redistribute it and/or modify |
|---|
| 13 | | - * it under the terms of the GNU General Public License version 2 as |
|---|
| 14 | | - * published by the Free Software Foundation. |
|---|
| 15 | 12 | */ |
|---|
| 16 | 13 | |
|---|
| 17 | 14 | #include <linux/module.h> |
|---|
| .. | .. |
|---|
| 399 | 396 | if (IS_ERR(micro->base)) |
|---|
| 400 | 397 | return PTR_ERR(micro->base); |
|---|
| 401 | 398 | |
|---|
| 402 | | - res = platform_get_resource(pdev, IORESOURCE_MEM, 1); |
|---|
| 403 | | - if (!res) |
|---|
| 404 | | - return -EINVAL; |
|---|
| 405 | | - |
|---|
| 406 | | - micro->sdlc = devm_ioremap_resource(&pdev->dev, res); |
|---|
| 399 | + micro->sdlc = devm_platform_ioremap_resource(pdev, 1); |
|---|
| 407 | 400 | if (IS_ERR(micro->sdlc)) |
|---|
| 408 | 401 | return PTR_ERR(micro->sdlc); |
|---|
| 409 | 402 | |
|---|
| 410 | 403 | micro_reset_comm(micro); |
|---|
| 411 | 404 | |
|---|
| 412 | 405 | irq = platform_get_irq(pdev, 0); |
|---|
| 413 | | - if (!irq) |
|---|
| 406 | + if (irq < 0) |
|---|
| 414 | 407 | return -EINVAL; |
|---|
| 415 | 408 | ret = devm_request_irq(&pdev->dev, irq, micro_serial_isr, |
|---|
| 416 | 409 | IRQF_SHARED, "ipaq-micro", |
|---|