| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Real Time Clock interface for XScale PXA27x and PXA3xx |
|---|
| 3 | 4 | * |
|---|
| 4 | 5 | * Copyright (C) 2008 Robert Jarzmik |
|---|
| 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, or |
|---|
| 9 | | - * (at your option) any later version. |
|---|
| 10 | | - * |
|---|
| 11 | | - * This program is distributed in the hope that it will be useful, |
|---|
| 12 | | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|---|
| 13 | | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|---|
| 14 | | - * GNU General Public License for more details. |
|---|
| 15 | | - * |
|---|
| 16 | | - * You should have received a copy of the GNU General Public License |
|---|
| 17 | | - * along with this program; if not, write to the Free Software |
|---|
| 18 | | - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|---|
| 19 | | - * |
|---|
| 20 | 6 | */ |
|---|
| 21 | 7 | |
|---|
| 22 | 8 | #include <linux/init.h> |
|---|
| .. | .. |
|---|
| 145 | 131 | |
|---|
| 146 | 132 | static irqreturn_t pxa_rtc_irq(int irq, void *dev_id) |
|---|
| 147 | 133 | { |
|---|
| 148 | | - struct platform_device *pdev = to_platform_device(dev_id); |
|---|
| 149 | | - struct pxa_rtc *pxa_rtc = platform_get_drvdata(pdev); |
|---|
| 134 | + struct pxa_rtc *pxa_rtc = dev_get_drvdata(dev_id); |
|---|
| 150 | 135 | u32 rtsr; |
|---|
| 151 | 136 | unsigned long events = 0; |
|---|
| 152 | 137 | |
|---|
| .. | .. |
|---|
| 339 | 324 | } |
|---|
| 340 | 325 | |
|---|
| 341 | 326 | sa1100_rtc->irq_1hz = platform_get_irq(pdev, 0); |
|---|
| 342 | | - if (sa1100_rtc->irq_1hz < 0) { |
|---|
| 343 | | - dev_err(dev, "No 1Hz IRQ resource defined\n"); |
|---|
| 327 | + if (sa1100_rtc->irq_1hz < 0) |
|---|
| 344 | 328 | return -ENXIO; |
|---|
| 345 | | - } |
|---|
| 346 | 329 | sa1100_rtc->irq_alarm = platform_get_irq(pdev, 1); |
|---|
| 347 | | - if (sa1100_rtc->irq_alarm < 0) { |
|---|
| 348 | | - dev_err(dev, "No alarm IRQ resource defined\n"); |
|---|
| 330 | + if (sa1100_rtc->irq_alarm < 0) |
|---|
| 349 | 331 | return -ENXIO; |
|---|
| 350 | | - } |
|---|
| 351 | 332 | |
|---|
| 352 | 333 | sa1100_rtc->rtc = devm_rtc_allocate_device(&pdev->dev); |
|---|
| 353 | 334 | if (IS_ERR(sa1100_rtc->rtc)) |
|---|