Commit 89576beb authored by Markus Elfring's avatar Markus Elfring Committed by Alexandre Belloni
parent eaa6ef56
...@@ -248,7 +248,6 @@ static const struct rtc_class_ops ftm_rtc_ops = { ...@@ -248,7 +248,6 @@ static const struct rtc_class_ops ftm_rtc_ops = {
static int ftm_rtc_probe(struct platform_device *pdev) static int ftm_rtc_probe(struct platform_device *pdev)
{ {
struct device_node *np = pdev->dev.of_node; struct device_node *np = pdev->dev.of_node;
struct resource *r;
int irq; int irq;
int ret; int ret;
struct ftm_rtc *rtc; struct ftm_rtc *rtc;
...@@ -265,13 +264,7 @@ static int ftm_rtc_probe(struct platform_device *pdev) ...@@ -265,13 +264,7 @@ static int ftm_rtc_probe(struct platform_device *pdev)
if (IS_ERR(rtc->rtc_dev)) if (IS_ERR(rtc->rtc_dev))
return PTR_ERR(rtc->rtc_dev); return PTR_ERR(rtc->rtc_dev);
r = platform_get_resource(pdev, IORESOURCE_MEM, 0); rtc->base = devm_platform_ioremap_resource(pdev, 0);
if (!r) {
dev_err(&pdev->dev, "cannot get resource for rtc\n");
return -ENODEV;
}
rtc->base = devm_ioremap_resource(&pdev->dev, r);
if (IS_ERR(rtc->base)) { if (IS_ERR(rtc->base)) {
dev_err(&pdev->dev, "cannot ioremap resource for rtc\n"); dev_err(&pdev->dev, "cannot ioremap resource for rtc\n");
return PTR_ERR(rtc->base); return PTR_ERR(rtc->base);
......
...@@ -165,7 +165,6 @@ static const struct rtc_class_ops goldfish_rtc_ops = { ...@@ -165,7 +165,6 @@ static const struct rtc_class_ops goldfish_rtc_ops = {
static int goldfish_rtc_probe(struct platform_device *pdev) static int goldfish_rtc_probe(struct platform_device *pdev)
{ {
struct goldfish_rtc *rtcdrv; struct goldfish_rtc *rtcdrv;
struct resource *r;
int err; int err;
rtcdrv = devm_kzalloc(&pdev->dev, sizeof(*rtcdrv), GFP_KERNEL); rtcdrv = devm_kzalloc(&pdev->dev, sizeof(*rtcdrv), GFP_KERNEL);
...@@ -173,12 +172,7 @@ static int goldfish_rtc_probe(struct platform_device *pdev) ...@@ -173,12 +172,7 @@ static int goldfish_rtc_probe(struct platform_device *pdev)
return -ENOMEM; return -ENOMEM;
platform_set_drvdata(pdev, rtcdrv); platform_set_drvdata(pdev, rtcdrv);
rtcdrv->base = devm_platform_ioremap_resource(pdev, 0);
r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!r)
return -ENODEV;
rtcdrv->base = devm_ioremap_resource(&pdev->dev, r);
if (IS_ERR(rtcdrv->base)) if (IS_ERR(rtcdrv->base))
return -ENODEV; return -ENODEV;
......
...@@ -218,7 +218,6 @@ static bool m48t86_verify_chip(struct platform_device *pdev) ...@@ -218,7 +218,6 @@ static bool m48t86_verify_chip(struct platform_device *pdev)
static int m48t86_rtc_probe(struct platform_device *pdev) static int m48t86_rtc_probe(struct platform_device *pdev)
{ {
struct m48t86_rtc_info *info; struct m48t86_rtc_info *info;
struct resource *res;
unsigned char reg; unsigned char reg;
int err; int err;
struct nvmem_config m48t86_nvmem_cfg = { struct nvmem_config m48t86_nvmem_cfg = {
...@@ -235,17 +234,11 @@ static int m48t86_rtc_probe(struct platform_device *pdev) ...@@ -235,17 +234,11 @@ static int m48t86_rtc_probe(struct platform_device *pdev)
if (!info) if (!info)
return -ENOMEM; return -ENOMEM;
res = platform_get_resource(pdev, IORESOURCE_MEM, 0); info->index_reg = devm_platform_ioremap_resource(pdev, 0);
if (!res)
return -ENODEV;
info->index_reg = devm_ioremap_resource(&pdev->dev, res);
if (IS_ERR(info->index_reg)) if (IS_ERR(info->index_reg))
return PTR_ERR(info->index_reg); return PTR_ERR(info->index_reg);
res = platform_get_resource(pdev, IORESOURCE_MEM, 1); info->data_reg = devm_platform_ioremap_resource(pdev, 1);
if (!res)
return -ENODEV;
info->data_reg = devm_ioremap_resource(&pdev->dev, res);
if (IS_ERR(info->data_reg)) if (IS_ERR(info->data_reg))
return PTR_ERR(info->data_reg); return PTR_ERR(info->data_reg);
......
...@@ -354,21 +354,16 @@ static void rtc7301_init(struct rtc7301_priv *priv) ...@@ -354,21 +354,16 @@ static void rtc7301_init(struct rtc7301_priv *priv)
static int __init rtc7301_rtc_probe(struct platform_device *dev) static int __init rtc7301_rtc_probe(struct platform_device *dev)
{ {
struct resource *res;
void __iomem *regs; void __iomem *regs;
struct rtc7301_priv *priv; struct rtc7301_priv *priv;
struct rtc_device *rtc; struct rtc_device *rtc;
int ret; int ret;
res = platform_get_resource(dev, IORESOURCE_MEM, 0);
if (!res)
return -ENODEV;
priv = devm_kzalloc(&dev->dev, sizeof(*priv), GFP_KERNEL); priv = devm_kzalloc(&dev->dev, sizeof(*priv), GFP_KERNEL);
if (!priv) if (!priv)
return -ENOMEM; return -ENOMEM;
regs = devm_ioremap_resource(&dev->dev, res); regs = devm_platform_ioremap_resource(dev, 0);
if (IS_ERR(regs)) if (IS_ERR(regs))
return PTR_ERR(regs); return PTR_ERR(regs);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment