net: korina: handle clk prepare error in korina_probe()
authorYuanjun Gong <ruc_gongyuanjun@163.com>
Mon, 31 Jul 2023 09:05:35 +0000 (17:05 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 11 Aug 2023 10:08:16 +0000 (12:08 +0200)
commit8afe27770dea9c4af991253c48db4a4dcc35f1a4
treef3db6da202c019347f3043e3a9687213df6d021e
parent58660666b46488152ec03dbde8a6e3e12b785fc9
net: korina: handle clk prepare error in korina_probe()

[ Upstream commit 0b6291ad1940c403734312d0e453e8dac9148f69 ]

in korina_probe(), the return value of clk_prepare_enable()
should be checked since it might fail. we can use
devm_clk_get_optional_enabled() instead of devm_clk_get_optional()
and clk_prepare_enable() to automatically handle the error.

Fixes: e4cd854ec487 ("net: korina: Get mdio input clock via common clock framework")
Signed-off-by: Yuanjun Gong <ruc_gongyuanjun@163.com>
Link: https://lore.kernel.org/r/20230731090535.21416-1-ruc_gongyuanjun@163.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/korina.c