]> git.baikalelectronics.ru Git - kernel.git/commit
net: fec: fix initial runtime PM refcount
authorLucas Stach <l.stach@pengutronix.de>
Mon, 3 Aug 2015 15:50:11 +0000 (17:50 +0200)
committerDavid S. Miller <davem@davemloft.net>
Fri, 7 Aug 2015 01:53:25 +0000 (18:53 -0700)
commitfc866dae549fe30334e52b3184d33b30e7e51ec2
treef20bc93cb449500e54bbe6afbddee1accfb90f23
parent297c3d0f563e6e5a430f7dcf66f76067e75b6351
net: fec: fix initial runtime PM refcount

The clocks are initially active and thus the device is marked active.
This still keeps the PM refcount at 0, the pm_runtime_put_autosuspend()
call at the end of probe then leaves us with an invalid refcount of -1,
which in turn leads to the device staying in suspended state even though
netdev open had been called.

Fix this by initializing the refcount to be coherent with the initial
device status.

Fixes:
c00e28efa57 (net: fec: Ensure clocks are enabled while using mdio bus)

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Tested-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/freescale/fec_main.c