Fix up CONFIG_PROC_FS=n
diff --git a/drivers/block/cpqarray.c b/drivers/block/cpqarray.c
index 3b9e8eb..bfba6f6 100644
--- a/drivers/block/cpqarray.c
+++ b/drivers/block/cpqarray.c
@@ -178,12 +178,6 @@
 static int revalidate_allvol(ctlr_info_t *host);
 static int cpqarray_register_ctlr(int ctlr, struct pci_dev *pdev);
 
-#ifdef CONFIG_PROC_FS
-static void ida_procinit(int i);
-#else
-static void ida_procinit(int i) {}
-#endif
-
 static inline drv_info_t *get_drv(struct gendisk *disk)
 {
 	return disk->private_data;
@@ -204,9 +198,6 @@
 	.revalidate_disk= ida_revalidate,
 };
 
-
-#ifdef CONFIG_PROC_FS
-
 static struct proc_dir_entry *proc_array;
 static const struct file_operations ida_proc_fops;
 
@@ -216,12 +207,15 @@
  */
 static void __init ida_procinit(int i)
 {
-	if (proc_array == NULL) {
-		proc_array = proc_mkdir("driver/cpqarray", NULL);
-		if (!proc_array) return;
-	}
+	if (IS_ENABLED(CONFIG_PROC_FS)) {
+		if (proc_array == NULL) {
+			proc_array = proc_mkdir("driver/cpqarray", NULL);
+			if (!proc_array) return;
+		}
 
-	proc_create_data(hba[i]->devname, 0, proc_array, &ida_proc_fops, hba[i]);
+		proc_create_data(hba[i]->devname, 0, proc_array,
+				 &ida_proc_fops, hba[i]);
+	}
 }
 
 /*
@@ -306,7 +300,6 @@
 	.llseek		= seq_lseek,
 	.release	= single_release,
 };
-#endif /* CONFIG_PROC_FS */
 
 module_param_array(eisa, int, NULL, 0);
 
diff --git a/drivers/net/hamradio/scc.c b/drivers/net/hamradio/scc.c
index bc1d521..485b515 100644
--- a/drivers/net/hamradio/scc.c
+++ b/drivers/net/hamradio/scc.c
@@ -1966,8 +1966,6 @@
 /* *		dump statistics to /proc/net/z8530drv		      * */
 /* ******************************************************************** */
 
-#ifdef CONFIG_PROC_FS
-
 static inline struct scc_channel *scc_net_seq_idx(loff_t pos)
 {
 	int k;
@@ -2095,8 +2093,6 @@
 	.release = seq_release_private,
 };
 
-#endif /* CONFIG_PROC_FS */
-
  
 /* ******************************************************************** */
 /* * 			Init SCC driver 			      * */
diff --git a/drivers/net/hamradio/yam.c b/drivers/net/hamradio/yam.c
index 4cf8f101..bb342ad 100644
--- a/drivers/net/hamradio/yam.c
+++ b/drivers/net/hamradio/yam.c
@@ -788,8 +788,6 @@
 	return IRQ_RETVAL(handled);
 }
 
-#ifdef CONFIG_PROC_FS
-
 static void *yam_seq_start(struct seq_file *seq, loff_t *pos)
 {
 	return (*pos < NR_PORTS) ? yam_devs[*pos] : NULL;
@@ -852,8 +850,6 @@
 	.release = seq_release,
 };
 
-#endif
-
 
 /* --------------------------------------------------------------------- */
 
diff --git a/drivers/net/ppp/pppoe.c b/drivers/net/ppp/pppoe.c
index bb07ba9..f864b53 100644
--- a/drivers/net/ppp/pppoe.c
+++ b/drivers/net/ppp/pppoe.c
@@ -995,7 +995,6 @@
 	return error;
 }
 
-#ifdef CONFIG_PROC_FS
 static int pppoe_seq_show(struct seq_file *seq, void *v)
 {
 	struct pppox_sock *po;
@@ -1099,8 +1098,6 @@
 	.release	= seq_release_net,
 };
 
-#endif /* CONFIG_PROC_FS */
-
 static const struct proto_ops pppoe_ops = {
 	.family		= AF_PPPOX,
 	.owner		= THIS_MODULE,
diff --git a/drivers/nubus/proc.c b/drivers/nubus/proc.c
index b8286ed..c15344b 100644
--- a/drivers/nubus/proc.c
+++ b/drivers/nubus/proc.c
@@ -147,17 +147,10 @@
 }
 EXPORT_SYMBOL(nubus_proc_attach_device);
 
-/* FIXME: this is certainly broken! */
 int nubus_proc_detach_device(struct nubus_dev *dev)
 {
-	struct proc_dir_entry *e;
-
-	if ((e = dev->procdir)) {
-		if (atomic_read(&e->count))
-			return -EBUSY;
-		remove_proc_entry(e->name, proc_bus_nubus_dir);
-		dev->procdir = NULL;
-	}
+	proc_remove(dev->procdir);
+	dev->procdir = NULL;
 	return 0;
 }
 EXPORT_SYMBOL(nubus_proc_detach_device);
diff --git a/drivers/staging/csr/io.c b/drivers/staging/csr/io.c
index f9b5c22..1b5f8ff 100644
--- a/drivers/staging/csr/io.c
+++ b/drivers/staging/csr/io.c
@@ -77,7 +77,6 @@
  */
 DECLARE_WAIT_QUEUE_HEAD(Unifi_cleanup_wq);
 
-#ifdef CONFIG_PROC_FS
 /*
  * seq_file wrappers for procfile show routines.
  */
@@ -98,8 +97,6 @@
 	.release	= seq_release,
 };
 
-#endif /* CONFIG_PROC_FS */
-
 #ifdef CSR_WIFI_RX_PATH_SPLIT
 
 static CsrResult signal_buffer_init(unifi_priv_t * priv, int size)
@@ -863,7 +860,6 @@
  *      None.
  * ---------------------------------------------------------------------------
  */
-#ifdef CONFIG_PROC_FS
 static int uf_proc_show(struct seq_file *m, void *v)
 {
 	unifi_priv_t *priv;
@@ -912,8 +908,6 @@
 	seq_putc(m, '\n');
 	return 0;
 }
-#endif
-
 
 
 
diff --git a/drivers/zorro/proc.c b/drivers/zorro/proc.c
index 6d3a602..1c15ee7 100644
--- a/drivers/zorro/proc.c
+++ b/drivers/zorro/proc.c
@@ -139,7 +139,7 @@
 				 &zorro_autocon[slot]);
 	if (!entry)
 		return -ENOMEM;
-	entry->size = sizeof(struct zorro_dev);
+	proc_set_size(entry, sizeof(struct zorro_dev));
 	return 0;
 }
 
diff --git a/include/linux/atmdev.h b/include/linux/atmdev.h
index c1da539..018d769 100644
--- a/include/linux/atmdev.h
+++ b/include/linux/atmdev.h
@@ -17,6 +17,8 @@
 #include <linux/proc_fs.h>
 
 extern struct proc_dir_entry *atm_proc_root;
+#else
+static struct proc_dir_entry *const atm_proc_root = NULL;
 #endif
 
 #ifdef CONFIG_COMPAT
diff --git a/include/linux/proc_fs.h b/include/linux/proc_fs.h
index b9bc1f2..cfba5ec 100644
--- a/include/linux/proc_fs.h
+++ b/include/linux/proc_fs.h
@@ -47,15 +47,20 @@
 	struct proc_dir_entry *parent) {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 struct proc_dir_entry *proc_mkdir_data(const char *name,
+						     umode_t mode,
+						     struct proc_dir_entry *parent,
+						     void *data)
+{ 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) {}
+static inline void *PDE_DATA(const struct inode *inode) { BUG(); return NULL; }
 static inline void *proc_get_parent_data(const struct inode *inode) { return NULL; }
 
 static inline 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) { return NULL; }
-static inline void proc_set_size(struct proc_dir_entry *de, loff_t size) {}
 
 static inline void proc_remove(struct proc_dir_entry *de) {}
 static inline void remove_proc_entry(const char *name, struct proc_dir_entry *parent) {}
diff --git a/include/linux/tty.h b/include/linux/tty.h
index e34605b..7a7003b0 100644
--- a/include/linux/tty.h
+++ b/include/linux/tty.h
@@ -662,8 +662,8 @@
 extern void proc_tty_register_driver(struct tty_driver *);
 extern void proc_tty_unregister_driver(struct tty_driver *);
 #else
-static inline void proc_tty_register_driver(struct tty_driver *) {}
-static inline void proc_tty_unregister_driver(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) {}
 #endif
 
 #endif
diff --git a/include/net/ax25.h b/include/net/ax25.h
index 89ed9ac..65d1585 100644
--- a/include/net/ax25.h
+++ b/include/net/ax25.h
@@ -382,7 +382,7 @@
 /* ax25_route.c */
 extern void ax25_rt_device_down(struct net_device *);
 extern int  ax25_rt_ioctl(unsigned int, void __user *);
-extern const struct file_operations ax25_route_fops;
+extern __weak const struct file_operations ax25_route_fops;
 extern ax25_route *ax25_get_route(ax25_address *addr, struct net_device *dev);
 extern int  ax25_rt_autobind(ax25_cb *, ax25_address *);
 extern struct sk_buff *ax25_rt_build_path(struct sk_buff *, ax25_address *, ax25_address *, ax25_digi *);
diff --git a/net/ax25/af_ax25.c b/net/ax25/af_ax25.c
index 7b11f8b..51ff19c 100644
--- a/net/ax25/af_ax25.c
+++ b/net/ax25/af_ax25.c
@@ -1846,8 +1846,6 @@
 	return res;
 }
 
-#ifdef CONFIG_PROC_FS
-
 static void *ax25_info_start(struct seq_file *seq, loff_t *pos)
 	__acquires(ax25_list_lock)
 {
@@ -1935,8 +1933,6 @@
 	.release = seq_release,
 };
 
-#endif
-
 static const struct net_proto_family ax25_family_ops = {
 	.family =	PF_AX25,
 	.create =	ax25_create,
diff --git a/net/decnet/af_decnet.c b/net/decnet/af_decnet.c
index c21f200..8566107 100644
--- a/net/decnet/af_decnet.c
+++ b/net/decnet/af_decnet.c
@@ -2110,7 +2110,6 @@
 	.func =		dn_route_rcv,
 };
 
-#ifdef CONFIG_PROC_FS
 struct dn_iter_state {
 	int bucket;
 };
@@ -2323,7 +2322,6 @@
 	.llseek		= seq_lseek,
 	.release	= seq_release_private,
 };
-#endif
 
 static const struct net_proto_family	dn_family_ops = {
 	.family =	AF_DECnet,
diff --git a/net/decnet/dn_dev.c b/net/decnet/dn_dev.c
index c8da116..dbab24b 100644
--- a/net/decnet/dn_dev.c
+++ b/net/decnet/dn_dev.c
@@ -1272,7 +1272,6 @@
 	return blocking_notifier_chain_unregister(&dnaddr_chain, nb);
 }
 
-#ifdef CONFIG_PROC_FS
 static inline int is_dn_dev(struct net_device *dev)
 {
 	return dev->dn_ptr != NULL;
@@ -1386,8 +1385,6 @@
 	.release = seq_release,
 };
 
-#endif /* CONFIG_PROC_FS */
-
 static int addr[2];
 module_param_array(addr, int, NULL, 0444);
 MODULE_PARM_DESC(addr, "The DECnet address of this machine: area,node");
diff --git a/net/decnet/dn_neigh.c b/net/decnet/dn_neigh.c
index f8637f9..d221f50 100644
--- a/net/decnet/dn_neigh.c
+++ b/net/decnet/dn_neigh.c
@@ -525,9 +525,6 @@
 	return state.t;
 }
 
-
-#ifdef CONFIG_PROC_FS
-
 static inline void dn_neigh_format_entry(struct seq_file *seq,
 					 struct neighbour *n)
 {
@@ -585,8 +582,6 @@
 	.release	= seq_release_net,
 };
 
-#endif
-
 void __init dn_neigh_init(void)
 {
 	neigh_table_init(&dn_neigh_table);
diff --git a/net/decnet/dn_route.c b/net/decnet/dn_route.c
index 5ac0e15..5ea500d 100644
--- a/net/decnet/dn_route.c
+++ b/net/decnet/dn_route.c
@@ -1755,7 +1755,6 @@
 	return skb->len;
 }
 
-#ifdef CONFIG_PROC_FS
 struct dn_rt_cache_iter_state {
 	int bucket;
 };
@@ -1849,8 +1848,6 @@
 	.release = seq_release_private,
 };
 
-#endif /* CONFIG_PROC_FS */
-
 void __init dn_route_init(void)
 {
 	int i, goal, order;
diff --git a/net/l2tp/l2tp_ppp.c b/net/l2tp/l2tp_ppp.c
index 637a341..011cdff 100644
--- a/net/l2tp/l2tp_ppp.c
+++ b/net/l2tp/l2tp_ppp.c
@@ -1546,8 +1546,6 @@
 
 static unsigned int pppol2tp_net_id;
 
-#ifdef CONFIG_PROC_FS
-
 struct pppol2tp_seq_data {
 	struct seq_net_private p;
 	int tunnel_idx;			/* current tunnel */
@@ -1734,8 +1732,6 @@
 	.release	= seq_release_net,
 };
 
-#endif /* CONFIG_PROC_FS */
-
 /*****************************************************************************
  * Network namespace
  *****************************************************************************/
diff --git a/net/netfilter/ipvs/ip_vs_app.c b/net/netfilter/ipvs/ip_vs_app.c
index 0b779d7..ebcb1f1 100644
--- a/net/netfilter/ipvs/ip_vs_app.c
+++ b/net/netfilter/ipvs/ip_vs_app.c
@@ -501,7 +501,6 @@
 }
 
 
-#ifdef CONFIG_PROC_FS
 /*
  *	/proc/net/ip_vs_app entry function
  */
@@ -598,7 +597,6 @@
 	.llseek  = seq_lseek,
 	.release = seq_release_net,
 };
-#endif
 
 int __net_init ip_vs_app_net_init(struct net *net)
 {
diff --git a/net/netfilter/ipvs/ip_vs_conn.c b/net/netfilter/ipvs/ip_vs_conn.c
index 704e514..4266b73 100644
--- a/net/netfilter/ipvs/ip_vs_conn.c
+++ b/net/netfilter/ipvs/ip_vs_conn.c
@@ -939,7 +939,6 @@
 /*
  *	/proc/net/ip_vs_conn entries
  */
-#ifdef CONFIG_PROC_FS
 struct ip_vs_iter_state {
 	struct seq_net_private	p;
 	struct hlist_head	*l;
@@ -1150,8 +1149,6 @@
 	.release = seq_release_net,
 };
 
-#endif
-
 
 /*
  *      Randomly drop connection entries before running out of memory
diff --git a/net/netfilter/ipvs/ip_vs_ctl.c b/net/netfilter/ipvs/ip_vs_ctl.c
index 9e2d1cc..f215ba4 100644
--- a/net/netfilter/ipvs/ip_vs_ctl.c
+++ b/net/netfilter/ipvs/ip_vs_ctl.c
@@ -1914,8 +1914,6 @@
 
 #endif
 
-#ifdef CONFIG_PROC_FS
-
 struct ip_vs_iter {
 	struct seq_net_private p;  /* Do not move this, netns depends upon it*/
 	struct list_head *table;
@@ -2237,7 +2235,6 @@
 	.llseek = seq_lseek,
 	.release = single_release_net,
 };
-#endif
 
 /*
  *	Set timeout values for tcp tcpfin udp in the timeout_table.
diff --git a/net/netrom/af_netrom.c b/net/netrom/af_netrom.c
index d1fa1d9..1936676 100644
--- a/net/netrom/af_netrom.c
+++ b/net/netrom/af_netrom.c
@@ -1255,8 +1255,6 @@
 	return 0;
 }
 
-#ifdef CONFIG_PROC_FS
-
 static void *nr_info_start(struct seq_file *seq, loff_t *pos)
 {
 	spin_lock_bh(&nr_list_lock);
@@ -1348,7 +1346,6 @@
 	.llseek = seq_lseek,
 	.release = seq_release,
 };
-#endif	/* CONFIG_PROC_FS */
 
 static const struct net_proto_family nr_family_ops = {
 	.family		=	PF_NETROM,
diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c
index 1d6793d..e01c72f 100644
--- a/net/packet/af_packet.c
+++ b/net/packet/af_packet.c
@@ -3752,8 +3752,6 @@
 	.notifier_call =	packet_notifier,
 };
 
-#ifdef CONFIG_PROC_FS
-
 static void *packet_seq_start(struct seq_file *seq, loff_t *pos)
 	__acquires(RCU)
 {
@@ -3820,8 +3818,6 @@
 	.release	= seq_release_net,
 };
 
-#endif
-
 static int __net_init packet_net_init(struct net *net)
 {
 	mutex_init(&net->packet.sklist_lock);
diff --git a/net/rose/af_rose.c b/net/rose/af_rose.c
index cf68e6e..59ecc1b 100644
--- a/net/rose/af_rose.c
+++ b/net/rose/af_rose.c
@@ -1377,7 +1377,6 @@
 	return 0;
 }
 
-#ifdef CONFIG_PROC_FS
 static void *rose_info_start(struct seq_file *seq, loff_t *pos)
 	__acquires(rose_list_lock)
 {
@@ -1469,7 +1468,6 @@
 	.llseek = seq_lseek,
 	.release = seq_release,
 };
-#endif	/* CONFIG_PROC_FS */
 
 static const struct net_proto_family rose_family_ops = {
 	.family		=	PF_ROSE,
diff --git a/sound/core/memalloc.c b/sound/core/memalloc.c
index 6915692..acf491a 100644
--- a/sound/core/memalloc.c
+++ b/sound/core/memalloc.c
@@ -365,13 +365,10 @@
 	mutex_unlock(&list_mutex);
 }
 
-
-#ifdef CONFIG_PROC_FS
 /*
  * proc file interface
  */
-#define SND_MEM_PROC_FILE	"driver/snd-page-alloc"
-static struct proc_dir_entry *snd_mem_proc;
+static const char SND_MEM_PROC_FILE[] = "driver/snd-page-alloc";
 
 static int snd_mem_proc_read(struct seq_file *seq, void *offset)
 {
@@ -505,24 +502,21 @@
 	.release	= single_release,
 };
 
-#endif /* CONFIG_PROC_FS */
-
 /*
  * module entry
  */
 
 static int __init snd_mem_init(void)
 {
-#ifdef CONFIG_PROC_FS
-	snd_mem_proc = proc_create(SND_MEM_PROC_FILE, 0644, NULL,
-				   &snd_mem_proc_fops);
-#endif
+	proc_create(SND_MEM_PROC_FILE, 0644, NULL, &snd_mem_proc_fops);
 	return 0;
 }
 
 static void __exit snd_mem_exit(void)
 {
+#ifdef CONFIG_PROC_FS
 	remove_proc_entry(SND_MEM_PROC_FILE, NULL);
+#endif
 	free_all_reserved_pages();
 	if (snd_allocated_pages > 0)
 		printk(KERN_ERR "snd-malloc: Memory leak?  pages not freed = %li\n", snd_allocated_pages);