.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
---|
1 | 2 | /* |
---|
2 | 3 | * RTC Driver for X-Powers AC100 |
---|
3 | 4 | * |
---|
4 | 5 | * Copyright (c) 2016 Chen-Yu Tsai |
---|
5 | 6 | * |
---|
6 | 7 | * Chen-Yu Tsai <wens@csie.org> |
---|
7 | | - * |
---|
8 | | - * This program is free software; you can redistribute it and/or modify |
---|
9 | | - * it under the terms of the GNU General Public License version 2 as |
---|
10 | | - * published by the Free Software Foundation. |
---|
11 | | - * |
---|
12 | | - * This program is distributed in the hope that it will be useful, but WITHOUT |
---|
13 | | - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
---|
14 | | - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for |
---|
15 | | - * more details. |
---|
16 | 8 | */ |
---|
17 | 9 | |
---|
18 | 10 | #include <linux/bcd.h> |
---|
.. | .. |
---|
586 | 578 | chip->regmap = ac100->regmap; |
---|
587 | 579 | |
---|
588 | 580 | chip->irq = platform_get_irq(pdev, 0); |
---|
589 | | - if (chip->irq < 0) { |
---|
590 | | - dev_err(&pdev->dev, "No IRQ resource\n"); |
---|
| 581 | + if (chip->irq < 0) |
---|
591 | 582 | return chip->irq; |
---|
592 | | - } |
---|
593 | 583 | |
---|
594 | 584 | chip->rtc = devm_rtc_allocate_device(&pdev->dev); |
---|
595 | 585 | if (IS_ERR(chip->rtc)) |
---|
.. | .. |
---|
620 | 610 | if (ret) |
---|
621 | 611 | return ret; |
---|
622 | 612 | |
---|
623 | | - ret = rtc_register_device(chip->rtc); |
---|
624 | | - if (ret) { |
---|
625 | | - dev_err(&pdev->dev, "unable to register device\n"); |
---|
626 | | - return ret; |
---|
627 | | - } |
---|
628 | | - |
---|
629 | | - dev_info(&pdev->dev, "RTC enabled\n"); |
---|
630 | | - |
---|
631 | | - return 0; |
---|
| 613 | + return rtc_register_device(chip->rtc); |
---|
632 | 614 | } |
---|
633 | 615 | |
---|
634 | 616 | static int ac100_rtc_remove(struct platform_device *pdev) |
---|