| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Emma Mobile Timer Support - STI |
|---|
| 3 | 4 | * |
|---|
| 4 | 5 | * Copyright (C) 2012 Magnus Damm |
|---|
| 5 | | - * |
|---|
| 6 | | - * This program is free software; you can redistribute it and/or modify |
|---|
| 7 | | - * it under the terms of the GNU General Public License as published by |
|---|
| 8 | | - * the Free Software Foundation; either version 2 of the License |
|---|
| 9 | | - * |
|---|
| 10 | | - * This program is distributed in the hope that it will be useful, |
|---|
| 11 | | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|---|
| 12 | | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|---|
| 13 | | - * GNU General Public License for more details. |
|---|
| 14 | | - * |
|---|
| 15 | | - * You should have received a copy of the GNU General Public License |
|---|
| 16 | | - * along with this program; if not, write to the Free Software |
|---|
| 17 | | - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|---|
| 18 | 6 | */ |
|---|
| 19 | 7 | |
|---|
| 20 | 8 | #include <linux/init.h> |
|---|
| .. | .. |
|---|
| 291 | 279 | static int em_sti_probe(struct platform_device *pdev) |
|---|
| 292 | 280 | { |
|---|
| 293 | 281 | struct em_sti_priv *p; |
|---|
| 294 | | - struct resource *res; |
|---|
| 295 | | - int irq; |
|---|
| 296 | | - int ret; |
|---|
| 282 | + int irq, ret; |
|---|
| 297 | 283 | |
|---|
| 298 | 284 | p = devm_kzalloc(&pdev->dev, sizeof(*p), GFP_KERNEL); |
|---|
| 299 | 285 | if (p == NULL) |
|---|
| .. | .. |
|---|
| 303 | 289 | platform_set_drvdata(pdev, p); |
|---|
| 304 | 290 | |
|---|
| 305 | 291 | irq = platform_get_irq(pdev, 0); |
|---|
| 306 | | - if (irq < 0) { |
|---|
| 307 | | - dev_err(&pdev->dev, "failed to get irq\n"); |
|---|
| 292 | + if (irq < 0) |
|---|
| 308 | 293 | return irq; |
|---|
| 309 | | - } |
|---|
| 310 | 294 | |
|---|
| 311 | 295 | /* map memory, let base point to the STI instance */ |
|---|
| 312 | | - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
|---|
| 313 | | - p->base = devm_ioremap_resource(&pdev->dev, res); |
|---|
| 296 | + p->base = devm_platform_ioremap_resource(pdev, 0); |
|---|
| 314 | 297 | if (IS_ERR(p->base)) |
|---|
| 315 | 298 | return PTR_ERR(p->base); |
|---|
| 316 | 299 | |
|---|