Message ID | 20230816142017.147173-20-biju.das.jz@bp.renesas.com (mailing list archive) |
---|---|
State | Accepted |
Headers | show |
Series | Add Renesas PMIC RAA215300 driver and builtin RTC support | expand |
diff --git a/drivers/rtc/class.c b/drivers/rtc/class.c index 431f16efed2d..c516c215c431 100644 --- a/drivers/rtc/class.c +++ b/drivers/rtc/class.c @@ -374,11 +374,11 @@ struct rtc_device *devm_rtc_allocate_device(struct device *dev) rtc->id = id; rtc->dev.parent = dev; - err = dev_set_name(&rtc->dev, "rtc%d", id); + err = devm_add_action_or_reset(dev, devm_rtc_release_device, rtc); if (err) return ERR_PTR(err); - err = devm_add_action_or_reset(dev, devm_rtc_release_device, rtc); + err = dev_set_name(&rtc->dev, "rtc%d", id); if (err) return ERR_PTR(err);