diff options
author | Logan Gunthorpe <logang@deltatee.com> | 2017-03-17 21:48:21 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-03-21 08:44:33 +0300 |
commit | d5ed9177f64fe95d9de79e6504d41612d9127e8a (patch) | |
tree | 4381e84b391db399b9e986582fc81aadf5bee6e9 /drivers/rtc/rtc-core.h | |
parent | dbef390d2eb0a7b0a6be21381a326d4e13953aba (diff) | |
download | linux-d5ed9177f64fe95d9de79e6504d41612d9127e8a.tar.xz |
rtc: utilize new cdev_device_add helper function
Mostly straightforward, but we had to remove the rtc_dev_add/del_device
functions as they split up the cdev_add and the device_add.
Doing this also revealed that there was likely another subtle bug:
seeing cdev_add was done after device_register, the cdev probably
was not ready before device_add when the uevent occurs. This would
race with userspace, if it tried to use the device directly after
the uevent. This is fixed just by using the new helper function.
Another weird thing is this driver would, in some error cases, call
cdev_add() without calling cdev_init. This patchset corrects this
by avoiding calling cdev_add if the devt is not set.
Signed-off-by: Logan Gunthorpe <logang@deltatee.com>
Acked-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/rtc/rtc-core.h')
-rw-r--r-- | drivers/rtc/rtc-core.h | 10 |
1 files changed, 0 insertions, 10 deletions
diff --git a/drivers/rtc/rtc-core.h b/drivers/rtc/rtc-core.h index a098aea197fc..7a4ed2f7c7d7 100644 --- a/drivers/rtc/rtc-core.h +++ b/drivers/rtc/rtc-core.h @@ -3,8 +3,6 @@ extern void __init rtc_dev_init(void); extern void __exit rtc_dev_exit(void); extern void rtc_dev_prepare(struct rtc_device *rtc); -extern void rtc_dev_add_device(struct rtc_device *rtc); -extern void rtc_dev_del_device(struct rtc_device *rtc); #else @@ -20,14 +18,6 @@ static inline void rtc_dev_prepare(struct rtc_device *rtc) { } -static inline void rtc_dev_add_device(struct rtc_device *rtc) -{ -} - -static inline void rtc_dev_del_device(struct rtc_device *rtc) -{ -} - #endif #ifdef CONFIG_RTC_INTF_PROC |