aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/rtc/sysfs.c
Commit message (Collapse)AuthorAgeFilesLines
* rtc: sysfs: use __ATTRIBUTE_GROUPS()Andy Shevchenko2025-07-221-5/+1
| | | | | | | | | Embrace __ATTRIBUTE_GROUPS() to avoid boiler plate code. This should not introduce any functional changes. Signed-off-by: Andy Shevchenko <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
* rtc: sysfs: Bail out earlier if no new groups providedAndy Shevchenko2025-07-221-4/+8
| | | | | | | | | | When there is no new groups provided, no need to reallocate memory, copy the old ones and free them in order to do nothing. Do nothing instead. Signed-off-by: Andy Shevchenko <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
* rtc: sysfs: Use sysfs_emit() to instead of s*printf()Andy Shevchenko2025-07-221-25/+21
| | | | | | | | | | Follow the advice of the Documentation/filesystems/sysfs.rst that show() should only use sysfs_emit() or sysfs_emit_at() when formatting the value to be returned to user space. Signed-off-by: Andy Shevchenko <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
* rtc: Include <linux/kstrtox.h> when appropriateChristophe JAILLET2022-11-151-0/+1
| | | | | | | | | | | The kstrto<something>() functions have been moved from kernel.h to kstrtox.h. So, include the latter directly in the appropriate files. Signed-off-by: Christophe JAILLET <[email protected]> Link: https://lore.kernel.org/r/786421fd0435a32206288904a1f879436a717529.1667721637.git.christophe.jaillet@wanadoo.fr Signed-off-by: Alexandre Belloni <[email protected]>
* rtc: sysfs: Correct kerneldoc function name hctosys_show()Yang Yingliang2021-06-201-1/+1
| | | | | | | | | | Fix the following make W=1 kernel build warning: drivers/rtc/sysfs.c:115: warning: expecting prototype for rtc_sysfs_show_hctosys(). Prototype was for hctosys_show() instead Signed-off-by: Yang Yingliang <[email protected]> Signed-off-by: Alexandre Belloni <[email protected]> Link: https://lore.kernel.org/r/[email protected]
* rtc: sysfs: check features instead of opsAlexandre Belloni2021-04-291-1/+1
| | | | | | | | Test RTC_FEATURE_ALARM instead of relying on .set_alarm to know whether alarms are available. Signed-off-by: Alexandre Belloni <[email protected]> Link: https://lore.kernel.org/r/[email protected]
* rtc: rework rtc_register_device() resource managementBartosz Golaszewski2020-11-191-2/+0
| | | | | | | | | | | | | | | | | | | | rtc_register_device() is a managed interface but it doesn't use devres by itself - instead it marks an rtc_device as "registered" and the devres callback for devm_rtc_allocate_device() takes care of resource release. This doesn't correspond with the design behind devres where managed structures should not be aware of being managed. The correct solution here is to register a separate devres callback for unregistering the device. While at it: rename rtc_register_device() to devm_rtc_register_device() and add it to the list of managed interfaces in devres.rst. This way we can avoid any potential confusion of driver developers who may expect there to exist a corresponding unregister function. Signed-off-by: Bartosz Golaszewski <[email protected]> Signed-off-by: Alexandre Belloni <[email protected]> Link: https://lore.kernel.org/r/[email protected]
* rtc: sysfs: use kobj_to_devsuguosong2020-03-161-1/+1
| | | | | | | | use kobj_to_dev instead of open-conding it Signed-off-by: suguosong <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
* rtc: sysfs: fix hctosys_show kerneldocAlexandre Belloni2019-11-271-1/+4
| | | | | | | | | | Fix undocumented function parameters: drivers/rtc/sysfs.c:112: warning: Function parameter or member 'dev' not described in 'hctosys_show' drivers/rtc/sysfs.c:112: warning: Function parameter or member 'attr' not described in 'hctosys_show' drivers/rtc/sysfs.c:112: warning: Function parameter or member 'buf' not described in 'hctosys_show' Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
* rtc: core: correct trivial checkpatch warningsAlexandre Belloni2019-04-041-9/+7
| | | | | | | Correct trivial checkpatch warnings, mostly whitespace issues and unbalanced braces. Signed-off-by: Alexandre Belloni <[email protected]>
* rtc: convert core to SPDX identifierAlexandre Belloni2019-03-181-5/+2
| | | | | | | Use SPDX-License-Identifier instead of a verbose license text. Also fix the block comment alignment. Signed-off-by: Alexandre Belloni <[email protected]>
* rtc: rename core filesAlexandre Belloni2018-12-311-0/+358
Rename core files so there is a clearer separation between the RTC core and the RTC drivers. Signed-off-by: Alexandre Belloni <[email protected]>