summaryrefslogtreecommitdiff
path: root/drivers/staging/fieldbus/dev_core.c
AgeCommit message (Collapse)AuthorFilesLines
2024-03-05staging: fieldbus: make fieldbus_class constantRicardo B. Marliere1-1/+1
Since commit 43a7206b0963 ("driver core: class: make class_register() take a const *"), the driver core allows for struct class to be in read-only memory, so move the fieldbus_class structure to be declared at build time placing it into read-only memory, instead of having to be dynamically allocated at boot time. Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: "Ricardo B. Marliere" <ricardo@marliere.net> Link: https://lore.kernel.org/r/20240301-class_cleanup-staging-v1-1-34db2a5b0eb0@marliere.net Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-01-24staging: fieldbus: Remove usage of the deprecated ida_simple_xx() APIChristophe JAILLET1-3/+3
ida_alloc() and ida_free() should be preferred to the deprecated ida_simple_get() and ida_simple_remove(). Note that the upper limit of ida_simple_get() is exclusive, but the one of ida_alloc_max() is inclusive. So a -1 has been added when needed. Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Link: https://lore.kernel.org/r/d305b97b1064ba7e026232fb8c2a0783ba1b1098.1705227001.git.christophe.jaillet@wanadoo.fr Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-03-17drivers: remove struct module * setting from struct classGreg Kroah-Hartman1-1/+0
There is no need to manually set the owner of a struct class, as the registering function does it automatically, so remove all of the explicit settings from various drivers that did so as it is unneeded. This allows us to remove this pointer entirely from this structure going forward. Cc: "Rafael J. Wysocki" <rafael@kernel.org> Link: https://lore.kernel.org/r/20230313181843.1207845-2-gregkh@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-11-09staging: fieldbus: use sysfs_emit() in show functionsDeepak R Varma1-10/+7
The show() methods should only use sysfs_emit() when formatting values to be returned to the user space. Ref: Documentation/filesystems/sysfs.rst Issue identified by coccicheck. Signed-off-by: Deepak R Varma <drv@mailo.com> Link: https://lore.kernel.org/r/Y2uEIzebbM/Fs5Jz@qemulion Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-11-23staging: fieldbus: use kobj_to_dev() to get deviceDing Xiang1-1/+1
Use kobj_to_dev() instead of container_of() Signed-off-by: Ding Xiang <dingxiang@cmss.chinamobile.com> Link: https://lore.kernel.org/r/20201117025933.668938-1-dingxiang@cmss.chinamobile.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-09-30staging: fieldbus core: remove unused stringsSven Van Asbroeck1-3/+0
Remove two unused static const strings - a leftover from a previous stage. Interestingly, neither gcc nor sparse warned about their presence. Signed-off-by: Sven Van Asbroeck <TheSven73@gmail.com> Link: https://lore.kernel.org/r/20190918183552.28959-2-TheSven73@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-05-20staging: fieldbus: solve warning incorrect type dev_core.cOscar Gomez Fuente1-3/+3
These changes solve a warning realated to an incorrect type inilizer in the function fieldbus_poll. Signed-off-by: Oscar Gomez Fuente <oscargomezf@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-04-17staging: add Fieldbus Device subsystem.Sven Van Asbroeck1-0/+351
Fieldbus device (client) adapters allow data exchange with a PLC aka. "Fieldbus Controller" over a fieldbus (Profinet, FLNet, etc.) They are typically used when a Linux device wants to expose itself as an actuator, motor, console light, switch, etc. over the fieldbus. This framework is designed to provide a generic interface to Fieldbus Devices from both the Linux Kernel and the userspace. Signed-off-by: Sven Van Asbroeck <TheSven73@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>