| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * ST M48T86 / Dallas DS12887 RTC driver |
|---|
| 3 | 4 | * Copyright (c) 2006 Tower Technologies |
|---|
| 4 | 5 | * |
|---|
| 5 | 6 | * 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. |
|---|
| 10 | 7 | * |
|---|
| 11 | 8 | * This drivers only supports the clock running in BCD and 24H mode. |
|---|
| 12 | 9 | * If it will be ever adapted to binary and 12H mode, care must be taken |
|---|
| .. | .. |
|---|
| 221 | 218 | static int m48t86_rtc_probe(struct platform_device *pdev) |
|---|
| 222 | 219 | { |
|---|
| 223 | 220 | struct m48t86_rtc_info *info; |
|---|
| 224 | | - struct resource *res; |
|---|
| 225 | 221 | unsigned char reg; |
|---|
| 226 | 222 | int err; |
|---|
| 227 | 223 | struct nvmem_config m48t86_nvmem_cfg = { |
|---|
| .. | .. |
|---|
| 238 | 234 | if (!info) |
|---|
| 239 | 235 | return -ENOMEM; |
|---|
| 240 | 236 | |
|---|
| 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); |
|---|
| 245 | 238 | if (IS_ERR(info->index_reg)) |
|---|
| 246 | 239 | return PTR_ERR(info->index_reg); |
|---|
| 247 | 240 | |
|---|
| 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); |
|---|
| 252 | 242 | if (IS_ERR(info->data_reg)) |
|---|
| 253 | 243 | return PTR_ERR(info->data_reg); |
|---|
| 254 | 244 | |
|---|