rapidio: use is_visible() to hide switch-specific attributes
Subsystems (2)
PATCH v2 1/1 rapidio: use is_visible() to hide switch-specific attributes
Instead of creating switch-specific attributes by hand, implement is_visible() method of attribute group and hide them when dealing with non-switch devices. This will ensure that all attributes are created together, before userspace gets notified of new device.
Also, remove rio-sysfs.c from list of files that are scanned when compiling RapiodIO documentations as it no longer has any structured comments, and leaving it in leads to warning when building docs.
Signed-off-by Dmitry Torokhov <[email protected]>
---
v2: drop rio-sysfs.c from Documentation/DocBook/rapidio.tmpl to avoid warnings when building docs.
Not tested on hardware, compiled only.
Documentation/DocBook/rapidio.tmpl | 3 -- drivers/rapidio/rio-sysfs.c | 76 +++++++++++++++++--------------------- drivers/rapidio/rio.c | 3 -- drivers/rapidio/rio.h | 2 - 4 files changed, 33 insertions(+), 51 deletions(-)
Documentation/DocBook/rapidio.tmpl +0 -3
@@ -129,9 +129,6 @@ <sect1 id="Device_model_support"><title>Device model support</title> !Idrivers/rapidio/rio-driver.c </sect1> - <sect1 id="Sysfs_support"><title>Sysfs support</title> -!Idrivers/rapidio/rio-sysfs.c - </sect1> <sect1 id="PPC32_support"><title>PPC32 support</title> !Iarch/powerpc/sysdev/fsl_rio.c </sect1>
drivers/rapidio/rio-sysfs.c +33 -43
94 lines not on this page · raw message
drivers/rapidio/rio.c +0 -3
@@ -192,8 +192,6 @@ int rio_add_device(struct rio_dev *rdev) }spin_unlock (&rio_global_list_lock); -rio_create_sysfs_dev_files (rdev); -return 0 ; }EXPORT_SYMBOL_GPL (rio_add_device);
@@ -220,7 +218,6 @@ void rio_del_device(struct rio_dev *rdev, enum rio_device_state state) } }spin_unlock (&rio_global_list_lock); -rio_remove_sysfs_dev_files (rdev);device_unregister (&rdev->dev); }EXPORT_SYMBOL_GPL (rio_del_device);
drivers/rapidio/rio.h +0 -2
@@ -27,8 +27,6 @@ extern u32 rio_mport_get_efb(struct rio_mport *port, int local, u16 destid, u8 hopcount, u32 from);extern int rio_mport_chk_dev_access (struct rio_mport *mport,u16 destid,u8 hopcount); -extern int rio_create_sysfs_dev_files (struct rio_dev *rdev); -extern void rio_remove_sysfs_dev_files (struct rio_dev *rdev);extern int rio_lock_device (struct rio_mport *port,u16 destid,u8 hopcount,int wait_ms);extern int rio_unlock_device (struct rio_mport *port,u16 destid,u8 hopcount);
Signature · 5 lines
2.11.0.483.g087da7b7c-goog -- Dmitry