summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2016-06-27 14:33:42 (GMT)
committerDavid S. Miller <davem@davemloft.net>2016-06-27 14:33:42 (GMT)
commit5db15872c5370d9ae7b1d1c972a48b598b23b824 (patch)
treedb81d20ce48b13b5e781785bed40f493c9b2409c /net
parent810bf11033637a2069952afb9c37f3afd3bbfe41 (diff)
parentb63f69d0fc1fa1e25842a2266633862d523c380f (diff)
downloadlinux-5db15872c5370d9ae7b1d1c972a48b598b23b824.tar.xz
Merge tag 'linux-can-next-for-4.8-20160623' of git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can-next
Marc Kleine-Budde says: ==================== pull-request: can-next 2016-06-17 this is a pull request of 4 patches for net-next/master. Arnd Bergmann's patch fixes a regresseion in af_can introduced in linux-can-next-for-4.8-20160617. There are two patches by Ramesh Shanmugasundaram, which add CAN-2.0 support to the rcar_canfd driver. And a patch by Ed Spiridonov that adds better error diagnoses messages to the Ed Spiridonov driver. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r--net/can/af_can.c22
-rw-r--r--net/can/af_can.h11
2 files changed, 12 insertions, 21 deletions
diff --git a/net/can/af_can.c b/net/can/af_can.c
index 166d436..1108079 100644
--- a/net/can/af_can.c
+++ b/net/can/af_can.c
@@ -911,14 +911,14 @@ static __init int can_init(void)
if (!rcv_cache)
return -ENOMEM;
- if (stats_timer) {
+ if (IS_ENABLED(CONFIG_PROC_FS)) {
+ if (stats_timer) {
/* the statistics are updated every second (timer triggered) */
- setup_timer(&can_stattimer, can_stat_update, 0);
- mod_timer(&can_stattimer, round_jiffies(jiffies + HZ));
- } else
- can_stattimer.function = NULL;
-
- can_init_proc();
+ setup_timer(&can_stattimer, can_stat_update, 0);
+ mod_timer(&can_stattimer, round_jiffies(jiffies + HZ));
+ }
+ can_init_proc();
+ }
/* protocol register */
sock_register(&can_family_ops);
@@ -933,10 +933,12 @@ static __exit void can_exit(void)
{
struct net_device *dev;
- if (stats_timer)
- del_timer_sync(&can_stattimer);
+ if (IS_ENABLED(CONFIG_PROC_FS)) {
+ if (stats_timer)
+ del_timer_sync(&can_stattimer);
- can_remove_proc();
+ can_remove_proc();
+ }
/* protocol unregister */
dev_remove_pack(&canfd_packet);
diff --git a/net/can/af_can.h b/net/can/af_can.h
index 38a79ff..fca0fe9 100644
--- a/net/can/af_can.h
+++ b/net/can/af_can.h
@@ -113,19 +113,8 @@ 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 */