i think you got the probe order right  create rtc  then register the notifier but i think you have the remove backwards  you probably want to tear down the notifier first  which can fail  and which should be done before you kill the rtc that it might notify  and then unregister the rtc  which cannot fail and because the rtc device unregister is devm you can just remove this line 