--- zzzz-none-000/linux-3.10.107/drivers/rtc/rtc-ep93xx.c 2017-06-27 09:49:32.000000000 +0000 +++ scorpion-7490-727/linux-3.10.107/drivers/rtc/rtc-ep93xx.c 2021-02-04 17:41:59.000000000 +0000 @@ -42,10 +42,10 @@ static int ep93xx_rtc_get_swcomp(struct device *dev, unsigned short *preload, unsigned short *delete) { - struct ep93xx_rtc *ep93xx_rtc = dev->platform_data; + struct ep93xx_rtc *ep93xx_rtc = dev_get_platdata(dev); unsigned long comp; - comp = __raw_readl(ep93xx_rtc->mmio_base + EP93XX_RTC_SWCOMP); + comp = readl(ep93xx_rtc->mmio_base + EP93XX_RTC_SWCOMP); if (preload) *preload = (comp & EP93XX_RTC_SWCOMP_INT_MASK) @@ -60,10 +60,10 @@ static int ep93xx_rtc_read_time(struct device *dev, struct rtc_time *tm) { - struct ep93xx_rtc *ep93xx_rtc = dev->platform_data; + struct ep93xx_rtc *ep93xx_rtc = dev_get_platdata(dev); unsigned long time; - time = __raw_readl(ep93xx_rtc->mmio_base + EP93XX_RTC_DATA); + time = readl(ep93xx_rtc->mmio_base + EP93XX_RTC_DATA); rtc_time_to_tm(time, tm); return 0; @@ -71,9 +71,9 @@ static int ep93xx_rtc_set_mmss(struct device *dev, unsigned long secs) { - struct ep93xx_rtc *ep93xx_rtc = dev->platform_data; + struct ep93xx_rtc *ep93xx_rtc = dev_get_platdata(dev); - __raw_writel(secs + 1, ep93xx_rtc->mmio_base + EP93XX_RTC_LOAD); + writel(secs + 1, ep93xx_rtc->mmio_base + EP93XX_RTC_LOAD); return 0; } @@ -138,17 +138,9 @@ return -ENOMEM; res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - if (!res) - return -ENXIO; - - if (!devm_request_mem_region(&pdev->dev, res->start, - resource_size(res), pdev->name)) - return -EBUSY; - - ep93xx_rtc->mmio_base = devm_ioremap(&pdev->dev, res->start, - resource_size(res)); - if (!ep93xx_rtc->mmio_base) - return -ENXIO; + ep93xx_rtc->mmio_base = devm_ioremap_resource(&pdev->dev, res); + if (IS_ERR(ep93xx_rtc->mmio_base)) + return PTR_ERR(ep93xx_rtc->mmio_base); pdev->dev.platform_data = ep93xx_rtc; platform_set_drvdata(pdev, ep93xx_rtc); @@ -167,7 +159,6 @@ return 0; exit: - platform_set_drvdata(pdev, NULL); pdev->dev.platform_data = NULL; return err; } @@ -175,7 +166,6 @@ static int ep93xx_rtc_remove(struct platform_device *pdev) { sysfs_remove_group(&pdev->dev.kobj, &ep93xx_rtc_sysfs_files); - platform_set_drvdata(pdev, NULL); pdev->dev.platform_data = NULL; return 0; @@ -184,7 +174,6 @@ static struct platform_driver ep93xx_rtc_driver = { .driver = { .name = "ep93xx-rtc", - .owner = THIS_MODULE, }, .probe = ep93xx_rtc_probe, .remove = ep93xx_rtc_remove,