proc: Make the PROC_I() and PDE() macros internal to procfs
[platform/adaptation/renesas_rcar/renesas_kernel.git] / include / linux / proc_fs.h
index 8f7d8f2..2112926 100644 (file)
@@ -67,42 +67,15 @@ struct proc_dir_entry *proc_create_data(const char *name, umode_t mode,
                                struct proc_dir_entry *parent,
                                const struct file_operations *proc_fops,
                                void *data);
+extern void proc_remove(struct proc_dir_entry *);
 extern void remove_proc_entry(const char *name, struct proc_dir_entry *parent);
 extern int remove_proc_subtree(const char *name, struct proc_dir_entry *parent);
 
-
-/*
- * proc_tty.c
- */
-struct tty_driver;
-#ifdef CONFIG_TTY
-extern void proc_tty_init(void);
-#else
-static inline void proc_tty_init(void)
-{ }
-#endif
-extern void proc_tty_register_driver(struct tty_driver *driver);
-extern void proc_tty_unregister_driver(struct tty_driver *driver);
-
-/*
- * proc_devtree.c
- */
-#ifdef CONFIG_PROC_DEVICETREE
-struct device_node;
-struct property;
-extern void proc_device_tree_init(void);
-extern void proc_device_tree_add_node(struct device_node *, struct proc_dir_entry *);
-extern void proc_device_tree_add_prop(struct proc_dir_entry *pde, struct property *prop);
-extern void proc_device_tree_remove_prop(struct proc_dir_entry *pde,
-                                        struct property *prop);
-extern void proc_device_tree_update_prop(struct proc_dir_entry *pde,
-                                        struct property *newprop,
-                                        struct property *oldprop);
-#endif /* CONFIG_PROC_DEVICETREE */
-
 extern struct proc_dir_entry *proc_symlink(const char *,
                struct proc_dir_entry *, const char *);
 extern struct proc_dir_entry *proc_mkdir(const char *,struct proc_dir_entry *);
+extern struct proc_dir_entry *proc_mkdir_data(const char *, umode_t,
+                                             struct proc_dir_entry *, void *);
 extern struct proc_dir_entry *proc_mkdir_mode(const char *name, umode_t mode,
                        struct proc_dir_entry *parent);
 
@@ -112,11 +85,10 @@ static inline struct proc_dir_entry *proc_create(const char *name, umode_t mode,
        return proc_create_data(name, mode, parent, proc_fops, NULL);
 }
  
-extern struct proc_dir_entry *proc_net_mkdir(struct net *net, const char *name,
-       struct proc_dir_entry *parent);
-
 extern void proc_set_size(struct proc_dir_entry *, loff_t);
 extern void proc_set_user(struct proc_dir_entry *, kuid_t, kgid_t);
+extern void *PDE_DATA(const struct inode *);
+extern void *proc_get_parent_data(const struct inode *);
 #else
 
 static inline void proc_flush_task(struct task_struct *task)
@@ -131,6 +103,7 @@ static inline struct proc_dir_entry *proc_create_data(const char *name,
 {
        return NULL;
 }
+static inline void proc_remove(struct proc_dir_entry *de) {}
 #define remove_proc_entry(name, parent) do {} while (0)
 #define remove_proc_subtree(name, parent) do {} while (0)
 
@@ -138,14 +111,13 @@ static inline struct proc_dir_entry *proc_symlink(const char *name,
                struct proc_dir_entry *parent,const char *dest) {return NULL;}
 static inline struct proc_dir_entry *proc_mkdir(const char *name,
        struct proc_dir_entry *parent) {return NULL;}
+static inline struct proc_dir_entry *proc_mkdir_data(const char *name,
+       umode_t mode, struct proc_dir_entry *parent, void *data) { return NULL; }
 static inline struct proc_dir_entry *proc_mkdir_mode(const char *name,
        umode_t mode, struct proc_dir_entry *parent) { return NULL; }
 static inline void proc_set_size(struct proc_dir_entry *de, loff_t size) {}
 static inline void proc_set_user(struct proc_dir_entry *de, kuid_t uid, kgid_t gid) {}
-
-struct tty_driver;
-static inline void proc_tty_register_driver(struct tty_driver *driver) {};
-static inline void proc_tty_unregister_driver(struct tty_driver *driver) {};
+static inline void *PDE_DATA(const struct inode *inode) {BUG(); return NULL;}
 
 #endif /* CONFIG_PROC_FS */
 
@@ -172,27 +144,10 @@ struct proc_inode {
        struct inode vfs_inode;
 };
 
-static inline struct proc_inode *PROC_I(const struct inode *inode)
+static inline struct proc_dir_entry *proc_net_mkdir(
+       struct net *net, const char *name, struct proc_dir_entry *parent)
 {
-       return container_of(inode, struct proc_inode, vfs_inode);
+       return proc_mkdir_data(name, 0, parent, net);
 }
 
-static inline struct proc_dir_entry *PDE(const struct inode *inode)
-{
-       return PROC_I(inode)->pde;
-}
-
-static inline void *PDE_DATA(const struct inode *inode)
-{
-       return PROC_I(inode)->pde->data;
-}
-
-static inline struct net *PDE_NET(struct proc_dir_entry *pde)
-{
-       return pde->parent->data;
-}
-
-#include <linux/signal.h>
-
-void render_sigset_t(struct seq_file *m, const char *header, sigset_t *set);
 #endif /* _LINUX_PROC_FS_H */