--- zzzz-none-000/linux-3.10.107/drivers/rtc/rtc-spear.c 2017-06-27 09:49:32.000000000 +0000 +++ scorpion-7490-727/linux-3.10.107/drivers/rtc/rtc-spear.c 2021-02-04 17:41:59.000000000 +0000 @@ -358,17 +358,9 @@ int status = 0; int irq; - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - if (!res) { - dev_err(&pdev->dev, "no resource defined\n"); - return -EBUSY; - } - config = devm_kzalloc(&pdev->dev, sizeof(*config), GFP_KERNEL); - if (!config) { - dev_err(&pdev->dev, "out of memory\n"); + if (!config) return -ENOMEM; - } /* alarm irqs */ irq = platform_get_irq(pdev, 0); @@ -385,6 +377,7 @@ return status; } + res = platform_get_resource(pdev, IORESOURCE_MEM, 0); config->ioaddr = devm_ioremap_resource(&pdev->dev, res); if (IS_ERR(config->ioaddr)) return PTR_ERR(config->ioaddr); @@ -417,7 +410,6 @@ return 0; err_disable_clock: - platform_set_drvdata(pdev, NULL); clk_disable_unprepare(config->clk); return status;