Date:2013-04-28 12:35:55 (7 years 2 months ago)
Author:Lars C.
Commit:aa5b7d06c7ba8aca95429b96eccce3cccb82d19c
Message:drivers/rtc/rtc-jz4740.c: Use managed resources

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Files: drivers/rtc/rtc-jz4740.c (4 diffs)

Change Details

drivers/rtc/rtc-jz4740.c
3939#define JZ_RTC_CTRL_ENABLE BIT(0)
4040
4141struct jz4740_rtc {
42    struct resource *mem;
4342    void __iomem *base;
4443
4544    struct rtc_device *rtc;
...... 
216215{
217216    int ret;
218217    struct jz4740_rtc *rtc;
218    struct resource *mem;
219219    uint32_t scratchpad;
220220    struct clk *rtc_clk;
221221
...... 
229229        return -ENOENT;
230230    }
231231
232    rtc->mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
233    if (!rtc->mem) {
234        dev_err(&pdev->dev, "Failed to get platform mmio memory\n");
235        return -ENOENT;
236    }
237
238    rtc->mem = devm_request_mem_region(&pdev->dev, rtc->mem->start,
239                    resource_size(rtc->mem), pdev->name);
240    if (!rtc->mem) {
241        dev_err(&pdev->dev, "Failed to request mmio memory region\n");
242        return -EBUSY;
243    }
244
245    rtc->base = devm_ioremap_nocache(&pdev->dev, rtc->mem->start,
246                    resource_size(rtc->mem));
247    if (!rtc->base) {
248        dev_err(&pdev->dev, "Failed to ioremap mmio memory\n");
249        return -EBUSY;
250    }
232    mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
233    rtc->base = devm_ioremap_resource(&pdev->dev, mem);
234    if (!rtc->base)
235        return PTR_ERR(rtc->base);
251236
252237    spin_lock_init(&rtc->lock);
253238
...... 
283268    rtc_clk = clk_get(&pdev->dev, "rtc");
284269    if (IS_ERR(rtc_clk)) {
285270        dev_err(&pdev->dev, "Failed to get RTC clock\n");
286        goto err_free_irq;
271        return PTR_ERR(rtc_clk);
287272    }
288273
289274    /* TODO: initialize the ADJC bits (25:16) to fine-tune

Archive Download the corresponding diff file



interactive