]> git.baikalelectronics.ru Git - kernel.git/commit
net: ethernet: ti: cpsw: use var instead of func for usage count
authorIvan Khoronzhuk <ivan.khoronzhuk@linaro.org>
Tue, 14 Feb 2017 14:02:36 +0000 (16:02 +0200)
committerDavid S. Miller <davem@davemloft.net>
Wed, 15 Feb 2017 03:30:42 +0000 (22:30 -0500)
commitcf791de9b2546a3166334c1954fb57228b6908c1
tree30551361df1d9dc94d177073ae1c40a17c4767ad
parent6c7b472ab8c4b85cc12ba8122a67775625422b67
net: ethernet: ti: cpsw: use var instead of func for usage count

The usage count function is based on ndev_running flag that is
updated before calling ndo_open/close, but if ndo is called in
another place, as with suspend/resume, the counter is not changed,
that breaks sus/resume. For common resource no difference which
device is using it, does matter only device count. So, replace
usage count function on var and inc and dec it in ndo_open/close.

Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/ti/cpsw.c