diff --git a/net/can/Makefile b/net/can/Makefile index cef49eb1f5c7bc37908c1f7b3432740f1b4c2377..10936754e3f272766cd3b699ee3acc8f58e89bfc 100644 --- a/net/can/Makefile +++ b/net/can/Makefile @@ -3,7 +3,8 @@ # obj-$(CONFIG_CAN) += can.o -can-y := af_can.o proc.o +can-y := af_can.o +can-$(CONFIG_PROC_FS) += proc.o obj-$(CONFIG_CAN_RAW) += can-raw.o can-raw-y := raw.o diff --git a/net/can/af_can.h b/net/can/af_can.h index fca0fe9fc45a497cdf3da82d5414e846e7cc61b7..38a79ff20022a2fbc1d3ed65250a1c1791aeb31f 100644 --- a/net/can/af_can.h +++ b/net/can/af_can.h @@ -113,8 +113,19 @@ struct s_pstats { extern struct dev_rcv_lists can_rx_alldev_list; /* function prototypes for the CAN networklayer procfs (proc.c) */ +#ifdef CONFIG_PROC_FS void can_init_proc(void); void can_remove_proc(void); +#else +static inline void can_init_proc(void) +{ + pr_info("can: Can't create /proc/net/can. CONFIG_PROC_FS missing!\n"); +} + +static inline void can_remove_proc(void) +{ +} +#endif void can_stat_update(unsigned long data); /* structures and variables from af_can.c needed in proc.c for reading */ diff --git a/net/can/proc.c b/net/can/proc.c index 1a19b985a8685b0aff4450acda4a8d4f429568bc..85ef7bb0f1768fdc34e41baae297893e4758d16c 100644 --- a/net/can/proc.c +++ b/net/can/proc.c @@ -517,8 +517,7 @@ void can_init_proc(void) can_dir = proc_mkdir("can", init_net.proc_net); if (!can_dir) { - printk(KERN_INFO "can: failed to create /proc/net/can . " - "CONFIG_PROC_FS missing?\n"); + pr_info("can: failed to create /proc/net/can.\n"); return; }