diff --git a/block/genhd.c b/block/genhd.c
index e8c42bfd12be305beeb93e6bed19c2ff1ff33638..68a5f28007e4b5dc41ee7e56ecb30b198bc19dc6 100644
--- a/block/genhd.c
+++ b/block/genhd.c
@@ -544,6 +544,7 @@ static struct device_type disk_type = {
 	.release	= disk_release,
 };
 
+#ifdef CONFIG_PROC_FS
 /*
  * aggregate disk stat collector.  Uses the same stats that the sysfs
  * entries do, above, but makes them available through one seq_file.
@@ -653,6 +654,7 @@ const struct seq_operations diskstats_op = {
 	.stop	= diskstats_stop,
 	.show	= diskstats_show
 };
+#endif /* CONFIG_PROC_FS */
 
 static void media_change_notify_thread(struct work_struct *work)
 {