Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

net: fec: drop check for clk==NULL before calling clk_*

clk_prepare, clk_enable and their counterparts (at least the common clk
ones, but also most others) do check for the clk being NULL anyhow (and
return 0 then), so there is no gain when the caller checks, too.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Acked-by: Fugang Duan <fugang.duan@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Uwe Kleine-König and committed by
David S. Miller
01e5943a 9652dc2e

+11 -14
+11 -14
drivers/net/ethernet/freescale/fec_main.c
··· 1841 1841 ret = clk_prepare_enable(fep->clk_ahb); 1842 1842 if (ret) 1843 1843 return ret; 1844 - if (fep->clk_enet_out) { 1845 - ret = clk_prepare_enable(fep->clk_enet_out); 1846 - if (ret) 1847 - goto failed_clk_enet_out; 1848 - } 1844 + 1845 + ret = clk_prepare_enable(fep->clk_enet_out); 1846 + if (ret) 1847 + goto failed_clk_enet_out; 1848 + 1849 1849 if (fep->clk_ptp) { 1850 1850 mutex_lock(&fep->ptp_clk_mutex); 1851 1851 ret = clk_prepare_enable(fep->clk_ptp); ··· 1857 1857 } 1858 1858 mutex_unlock(&fep->ptp_clk_mutex); 1859 1859 } 1860 - if (fep->clk_ref) { 1861 - ret = clk_prepare_enable(fep->clk_ref); 1862 - if (ret) 1863 - goto failed_clk_ref; 1864 - } 1860 + 1861 + ret = clk_prepare_enable(fep->clk_ref); 1862 + if (ret) 1863 + goto failed_clk_ref; 1865 1864 } else { 1866 1865 clk_disable_unprepare(fep->clk_ahb); 1867 - if (fep->clk_enet_out) 1868 - clk_disable_unprepare(fep->clk_enet_out); 1866 + clk_disable_unprepare(fep->clk_enet_out); 1869 1867 if (fep->clk_ptp) { 1870 1868 mutex_lock(&fep->ptp_clk_mutex); 1871 1869 clk_disable_unprepare(fep->clk_ptp); 1872 1870 fep->ptp_clk_on = false; 1873 1871 mutex_unlock(&fep->ptp_clk_mutex); 1874 1872 } 1875 - if (fep->clk_ref) 1876 - clk_disable_unprepare(fep->clk_ref); 1873 + clk_disable_unprepare(fep->clk_ref); 1877 1874 } 1878 1875 1879 1876 return 0;