forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-05-10 61598093bbdd283a7edc367d900f223070ead8d2
kernel/drivers/rtc/rtc-m48t86.c
....@@ -1,12 +1,9 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * ST M48T86 / Dallas DS12887 RTC driver
34 * Copyright (c) 2006 Tower Technologies
45 *
56 * Author: Alessandro Zummo <a.zummo@towertech.it>
6
- *
7
- * This program is free software; you can redistribute it and/or modify
8
- * it under the terms of the GNU General Public License version 2 as
9
- * published by the Free Software Foundation.
107 *
118 * This drivers only supports the clock running in BCD and 24H mode.
129 * If it will be ever adapted to binary and 12H mode, care must be taken
....@@ -221,7 +218,6 @@
221218 static int m48t86_rtc_probe(struct platform_device *pdev)
222219 {
223220 struct m48t86_rtc_info *info;
224
- struct resource *res;
225221 unsigned char reg;
226222 int err;
227223 struct nvmem_config m48t86_nvmem_cfg = {
....@@ -238,17 +234,11 @@
238234 if (!info)
239235 return -ENOMEM;
240236
241
- res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
242
- if (!res)
243
- return -ENODEV;
244
- info->index_reg = devm_ioremap_resource(&pdev->dev, res);
237
+ info->index_reg = devm_platform_ioremap_resource(pdev, 0);
245238 if (IS_ERR(info->index_reg))
246239 return PTR_ERR(info->index_reg);
247240
248
- res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
249
- if (!res)
250
- return -ENODEV;
251
- info->data_reg = devm_ioremap_resource(&pdev->dev, res);
241
+ info->data_reg = devm_platform_ioremap_resource(pdev, 1);
252242 if (IS_ERR(info->data_reg))
253243 return PTR_ERR(info->data_reg);
254244