Skip to contentSkip to conversation

rtcan: Update procfs usage to latest kernel API

PATCH New Jan Kiszka 1 participant 1 message Aug 21, 2013 Generic include/asm header files

lore
Share & tools
lore

Jan Kiszka

author
#0 lore raw

PATCH 1/1 rtcan: Update procfs usage to latest kernel API

This both overcomes RTCAN_PROC_* macros and makes the CAN layer compatible with kernel 3.10. We simply switch all procfs nodes to seq_file.

---

For review. This is part of my for-upstream queue. Note that I only tested with virtual CAN, build-tested sja1000 and couldn't test MSCAN.

 include/asm-generic/wrappers.h                |   13 ++
 ksrc/drivers/can/mscan/rtcan_mscan_proc.c     |  147 +++++++-------
 ksrc/drivers/can/rtcan_internal.h             |   62 ------
 ksrc/drivers/can/rtcan_module.c               |  266 ++++++++++++-------------
 ksrc/drivers/can/sja1000/rtcan_sja1000_proc.c |   48 ++---
 5 files changed, 233 insertions(+), 303 deletions(-)
include/asm-generic/wrappers.h +13 -0
index 0a4b45b..9108cbd 100644
@@ -784,6 +784,19 @@ proc_create_data(const char *name, mode_t mode, struct proc_dir_entry *parent,
 	return pde;
 }
 #endif /* < 2.6.26 */
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,25)
+static inline struct proc_dir_entry *
+proc_create(const char *name, mode_t mode, struct proc_dir_entry *parent,
+	    const struct file_operations *proc_fops)
+{
+	struct proc_dir_entry *pde = create_proc_entry(name, mode, parent);
+
+	if (pde)
+		pde->proc_fops = proc_fops;
+	return pde;
+}
+#endif /* < 2.6.25 */
 #endif /* < 3.10 */
 
 #endif /* _XENO_ASM_GENERIC_WRAPPERS_H */
ksrc/drivers/can/mscan/rtcan_mscan_proc.c +71 -76

177 lines not on this page · raw message

ksrc/drivers/can/rtcan_internal.h +0 -62

68 lines not on this page · raw message

ksrc/drivers/can/rtcan_module.c +129 -137

392 lines not on this page · raw message

ksrc/drivers/can/sja1000/rtcan_sja1000_proc.c +20 -28

70 lines not on this page · raw message

Signature · 1 line
1.7.3.4