.. | .. |
---|
324 | 324 | |
---|
325 | 325 | spin_lock_init(&pdata->alarm_lock); |
---|
326 | 326 | |
---|
| 327 | + pdata->rtc = devm_rtc_allocate_device(&pdev->dev); |
---|
| 328 | + if (IS_ERR(pdata->rtc)) |
---|
| 329 | + return PTR_ERR(pdata->rtc); |
---|
| 330 | + |
---|
327 | 331 | clk_prepare_enable(pdata->clk); |
---|
328 | 332 | |
---|
329 | 333 | pic32_rtc_enable(pdata, 1); |
---|
330 | 334 | |
---|
331 | 335 | device_init_wakeup(&pdev->dev, 1); |
---|
332 | | - |
---|
333 | | - pdata->rtc = devm_rtc_allocate_device(&pdev->dev); |
---|
334 | | - if (IS_ERR(pdata->rtc)) |
---|
335 | | - return PTR_ERR(pdata->rtc); |
---|
336 | 336 | |
---|
337 | 337 | pdata->rtc->ops = &pic32_rtcops; |
---|
338 | 338 | pdata->rtc->range_min = RTC_TIMESTAMP_BEGIN_2000; |
---|