hc
2024-05-10 ee930fffee469d076998274a2ca55e13dc1efb67
kernel/drivers/rtc/rtc-sunxi.c
....@@ -1,21 +1,8 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * An RTC driver for Allwinner A10/A20
34 *
45 * Copyright (c) 2013, Carlo Caione <carlo.caione@gmail.com>
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, but WITHOUT
12
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
14
- * more details.
15
- *
16
- * You should have received a copy of the GNU General Public License along
17
- * with this program; if not, write to the Free Software Foundation, Inc.,
18
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
196 */
207
218 #include <linux/delay.h>
....@@ -435,7 +422,6 @@
435422 static int sunxi_rtc_probe(struct platform_device *pdev)
436423 {
437424 struct sunxi_rtc_dev *chip;
438
- struct resource *res;
439425 int ret;
440426
441427 chip = devm_kzalloc(&pdev->dev, sizeof(*chip), GFP_KERNEL);
....@@ -449,16 +435,13 @@
449435 if (IS_ERR(chip->rtc))
450436 return PTR_ERR(chip->rtc);
451437
452
- res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
453
- chip->base = devm_ioremap_resource(&pdev->dev, res);
438
+ chip->base = devm_platform_ioremap_resource(pdev, 0);
454439 if (IS_ERR(chip->base))
455440 return PTR_ERR(chip->base);
456441
457442 chip->irq = platform_get_irq(pdev, 0);
458
- if (chip->irq < 0) {
459
- dev_err(&pdev->dev, "No IRQ resource\n");
443
+ if (chip->irq < 0)
460444 return chip->irq;
461
- }
462445 ret = devm_request_irq(&pdev->dev, chip->irq, sunxi_rtc_alarmirq,
463446 0, dev_name(&pdev->dev), chip);
464447 if (ret) {
....@@ -487,15 +470,7 @@
487470
488471 chip->rtc->ops = &sunxi_rtc_ops;
489472
490
- ret = rtc_register_device(chip->rtc);
491
- if (ret) {
492
- dev_err(&pdev->dev, "unable to register device\n");
493
- return ret;
494
- }
495
-
496
- dev_info(&pdev->dev, "RTC enabled\n");
497
-
498
- return 0;
473
+ return rtc_register_device(chip->rtc);
499474 }
500475
501476 static struct platform_driver sunxi_rtc_driver = {