.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
---|
1 | 2 | /* |
---|
2 | 3 | * EPSON TOYOCOM RTC-7301SF/DG Driver |
---|
3 | 4 | * |
---|
.. | .. |
---|
353 | 354 | |
---|
354 | 355 | static int __init rtc7301_rtc_probe(struct platform_device *dev) |
---|
355 | 356 | { |
---|
356 | | - struct resource *res; |
---|
357 | 357 | void __iomem *regs; |
---|
358 | 358 | struct rtc7301_priv *priv; |
---|
359 | 359 | struct rtc_device *rtc; |
---|
360 | 360 | int ret; |
---|
361 | 361 | |
---|
362 | | - res = platform_get_resource(dev, IORESOURCE_MEM, 0); |
---|
363 | | - if (!res) |
---|
364 | | - return -ENODEV; |
---|
365 | | - |
---|
366 | 362 | priv = devm_kzalloc(&dev->dev, sizeof(*priv), GFP_KERNEL); |
---|
367 | 363 | if (!priv) |
---|
368 | 364 | return -ENOMEM; |
---|
369 | 365 | |
---|
370 | | - regs = devm_ioremap_resource(&dev->dev, res); |
---|
| 366 | + regs = devm_platform_ioremap_resource(dev, 0); |
---|
371 | 367 | if (IS_ERR(regs)) |
---|
372 | 368 | return PTR_ERR(regs); |
---|
373 | 369 | |
---|