]> git.baikalelectronics.ru Git - kernel.git/commit
rtc: sysfs: facilitate attribute add to rtc device
authorDenis Osterland <Denis.Osterland@diehl.com>
Tue, 24 Jul 2018 11:31:22 +0000 (11:31 +0000)
committerAlexandre Belloni <alexandre.belloni@bootlin.com>
Tue, 14 Aug 2018 20:56:27 +0000 (22:56 +0200)
commit8f9d089d99d24e71a89286b30e2fc96c6e7cb989
treebad29fcf1b32aa3ff90241f8f588f7eef3dfdfa0
parent65f2c993816ecd9658834ebc1ea3cec89a55b372
rtc: sysfs: facilitate attribute add to rtc device

This patches addresses following problem:
rtc_allocate_device
devm_device_add_group  <-- kernel oops / null pointer, because
sysfs entry does not yet exist
rtc_register_device
rc = devm_device_add_group
if (rc)
return rc;     <-- forbidden to return error code
after device register

This patch adds rtc_add_group(s) functions.
The functions store the sum of attribute groups as device resource.

Signed-off-by: Denis Osterland <Denis.Osterland@diehl.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
drivers/rtc/rtc-core.h
drivers/rtc/rtc-sysfs.c