treewide: remove redundant IS_ERR() before error code check
[linux/fpc-iii.git] / arch / mips / dec / platform.c
blobc4fcb8c58e01cefc0088ab8b1d7a94d7162a1594
1 // SPDX-License-Identifier: GPL-2.0-or-later
2 /*
3 * DEC platform devices.
5 * Copyright (c) 2014 Maciej W. Rozycki
6 */
8 #include <linux/ioport.h>
9 #include <linux/kernel.h>
10 #include <linux/mc146818rtc.h>
11 #include <linux/platform_device.h>
13 static struct resource dec_rtc_resources[] = {
15 .name = "rtc",
16 .flags = IORESOURCE_MEM,
20 static struct cmos_rtc_board_info dec_rtc_info = {
21 .flags = CMOS_RTC_FLAGS_NOFREQ,
22 .address_space = 64,
25 static struct platform_device dec_rtc_device = {
26 .name = "rtc_cmos",
27 .id = PLATFORM_DEVID_NONE,
28 .dev.platform_data = &dec_rtc_info,
29 .resource = dec_rtc_resources,
30 .num_resources = ARRAY_SIZE(dec_rtc_resources),
33 static int __init dec_add_devices(void)
35 dec_rtc_resources[0].start = RTC_PORT(0);
36 dec_rtc_resources[0].end = RTC_PORT(0) + dec_kn_slot_size - 1;
37 return platform_device_register(&dec_rtc_device);
40 device_initcall(dec_add_devices);