aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/rtc/class.c
diff options
context:
space:
mode:
authorAlexandre Belloni <alexandre.belloni@bootlin.com>2019-08-19 00:00:40 +0200
committerAlexandre Belloni <alexandre.belloni@bootlin.com>2019-08-20 21:44:45 +0200
commit924068e50a6ca426b8fda1d2c06d6d2bde212136 (patch)
tree4d3286bb946e0198c7a7c48a2aea7f1135e9e1b9 /drivers/rtc/class.c
parentcb36cf803f3f468baa22b165bc4e67ae88811ad1 (diff)
downloadlinux-924068e50a6ca426b8fda1d2c06d6d2bde212136.tar.gz
rtc: class: add debug message when registration fails
Add a message when __rtc_register_device fails because rtc->ops is NULL. This may only happen when developing a new driver so use dev_dbg to avoid compiling it in by default. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Link: https://lore.kernel.org/r/20190818220041.17833-1-alexandre.belloni@bootlin.com Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Diffstat (limited to 'drivers/rtc/class.c')
-rw-r--r--drivers/rtc/class.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/rtc/class.c b/drivers/rtc/class.c
index 0f492b0940b3a..9458e6d6686ac 100644
--- a/drivers/rtc/class.c
+++ b/drivers/rtc/class.c
@@ -346,8 +346,10 @@ int __rtc_register_device(struct module *owner, struct rtc_device *rtc)
struct rtc_wkalrm alrm;
int err;
- if (!rtc->ops)
+ if (!rtc->ops) {
+ dev_dbg(&rtc->dev, "no ops set\n");
return -EINVAL;
+ }
rtc->owner = owner;
rtc_device_get_offset(rtc);