]> git.baikalelectronics.ru Git - kernel.git/commit
net: gemini: Fix another missing clk_disable_unprepare() in probe
authorDan Carpenter <dan.carpenter@oracle.com>
Wed, 2 Sep 2020 11:56:31 +0000 (14:56 +0300)
committerDavid S. Miller <davem@davemloft.net>
Wed, 2 Sep 2020 22:40:18 +0000 (15:40 -0700)
commit65fc26bf4bc687b6e3953f0d4bc3f3d7eb03fa6a
tree3c53f95691ab09dfee0bb8d071b9ecb9c66dbe13
parentfbb094c6e6633f5ce15910e224b3922f58120c6f
net: gemini: Fix another missing clk_disable_unprepare() in probe

We recently added some calls to clk_disable_unprepare() but we missed
the last error path if register_netdev() fails.

I made a couple cleanups so we avoid mistakes like this in the future.
First I reversed the "if (!ret)" condition and pulled the code in one
indent level.  Also, the "port->netdev = NULL;" is not required because
"port" isn't used again outside this function so I deleted that line.

Fixes: a8b83602f149 ("net: ethernet: Add a driver for Gemini gigabit ethernet")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/cortina/gemini.c