net: macb: fix call to pm_runtime in the suspend/resume functions
authorNicolas Ferre <nicolas.ferre@microchip.com>
Fri, 10 Jul 2020 12:46:45 +0000 (14:46 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 16 Jul 2020 06:16:41 +0000 (08:16 +0200)
commitf62f896a56a2ef8468d18462a0e7447f8cca9a7e
tree72b6579931df0b2719a09a5203f6fa64aab04f29
parentad396c483dd5fe3e3509200fa31d47b4f1689bc1
net: macb: fix call to pm_runtime in the suspend/resume functions

[ Upstream commit 6c8f85cac98a4c6b767c4c4f6af7283724c32b47 ]

The calls to pm_runtime_force_suspend/resume() functions are only
relevant if the device is not configured to act as a WoL wakeup source.
Add the device_may_wakeup() test before calling them.

Fixes: 3e2a5e153906 ("net: macb: add wake-on-lan support via magic packet")
Cc: Claudiu Beznea <claudiu.beznea@microchip.com>
Cc: Harini Katakam <harini.katakam@xilinx.com>
Cc: Sergio Prado <sergio.prado@e-labworks.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Nicolas Ferre <nicolas.ferre@microchip.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/cadence/macb_main.c