--- zzzz-none-000/linux-3.10.107/drivers/rtc/rtc-tx4939.c 2017-06-27 09:49:32.000000000 +0000 +++ scorpion-7490-727/linux-3.10.107/drivers/rtc/rtc-tx4939.c 2021-02-04 17:41:59.000000000 +0000 @@ -176,8 +176,8 @@ tx4939_rtc_cmd(rtcreg, TX4939_RTCCTL_COMMAND_NOP); } spin_unlock(&pdata->lock); - if (likely(pdata->rtc)) - rtc_update_irq(pdata->rtc, 1, events); + rtc_update_irq(pdata->rtc, 1, events); + return IRQ_HANDLED; } @@ -199,8 +199,7 @@ ssize_t count; spin_lock_irq(&pdata->lock); - for (count = 0; size > 0 && pos < TX4939_RTC_REG_RAMSIZE; - count++, size--) { + for (count = 0; count < size; count++) { __raw_writel(pos++, &rtcreg->adr); *buf++ = __raw_readl(&rtcreg->dat); } @@ -218,8 +217,7 @@ ssize_t count; spin_lock_irq(&pdata->lock); - for (count = 0; size > 0 && pos < TX4939_RTC_REG_RAMSIZE; - count++, size--) { + for (count = 0; count < size; count++) { __raw_writel(pos++, &rtcreg->adr); __raw_writel(*buf++, &rtcreg->dat); } @@ -244,9 +242,6 @@ struct resource *res; int irq, ret; - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - if (!res) - return -ENODEV; irq = platform_get_irq(pdev, 0); if (irq < 0) return -ENODEV; @@ -255,13 +250,10 @@ return -ENOMEM; platform_set_drvdata(pdev, pdata); - if (!devm_request_mem_region(&pdev->dev, res->start, - resource_size(res), pdev->name)) - return -EBUSY; - pdata->rtcreg = devm_ioremap(&pdev->dev, res->start, - resource_size(res)); - if (!pdata->rtcreg) - return -EBUSY; + res = platform_get_resource(pdev, IORESOURCE_MEM, 0); + pdata->rtcreg = devm_ioremap_resource(&pdev->dev, res); + if (IS_ERR(pdata->rtcreg)) + return PTR_ERR(pdata->rtcreg); spin_lock_init(&pdata->lock); tx4939_rtc_cmd(pdata->rtcreg, TX4939_RTCCTL_COMMAND_NOP); @@ -293,7 +285,6 @@ .remove = __exit_p(tx4939_rtc_remove), .driver = { .name = "tx4939rtc", - .owner = THIS_MODULE, }, };