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

Configure Feed

Select the types of activity you want to include in your feed.

phy: mediatek: phy-mtk-mipi-dsi: Simplify with dev_err_probe()

Use the dev_err_probe() helper to simplify error handling during probe.

Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://lore.kernel.org/r/20220328145217.228457-1-angelogioacchino.delregno@collabora.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>

authored by

AngeloGioacchino Del Regno and committed by
Vinod Koul
b7b930f3 09cc358a

+10 -19
+10 -19
drivers/phy/mediatek/phy-mtk-mipi-dsi.c
··· 154 154 return PTR_ERR(mipi_tx->regs); 155 155 156 156 ref_clk = devm_clk_get(dev, NULL); 157 - if (IS_ERR(ref_clk)) { 158 - ret = PTR_ERR(ref_clk); 159 - dev_err(dev, "Failed to get reference clock: %d\n", ret); 160 - return ret; 161 - } 157 + if (IS_ERR(ref_clk)) 158 + return dev_err_probe(dev, PTR_ERR(ref_clk), 159 + "Failed to get reference clock\n"); 162 160 163 161 ret = of_property_read_u32(dev->of_node, "drive-strength-microamp", 164 162 &mipi_tx->mipitx_drive); ··· 176 178 177 179 ret = of_property_read_string(dev->of_node, "clock-output-names", 178 180 &clk_init.name); 179 - if (ret < 0) { 180 - dev_err(dev, "Failed to read clock-output-names: %d\n", ret); 181 - return ret; 182 - } 181 + if (ret < 0) 182 + return dev_err_probe(dev, ret, "Failed to read clock-output-names\n"); 183 183 184 184 clk_init.ops = mipi_tx->driver_data->mipi_tx_clk_ops; 185 185 186 186 mipi_tx->pll_hw.init = &clk_init; 187 187 mipi_tx->pll = devm_clk_register(dev, &mipi_tx->pll_hw); 188 - if (IS_ERR(mipi_tx->pll)) { 189 - ret = PTR_ERR(mipi_tx->pll); 190 - dev_err(dev, "Failed to register PLL: %d\n", ret); 191 - return ret; 192 - } 188 + if (IS_ERR(mipi_tx->pll)) 189 + return dev_err_probe(dev, PTR_ERR(mipi_tx->pll), "Failed to register PLL\n"); 193 190 194 191 phy = devm_phy_create(dev, NULL, &mtk_mipi_tx_ops); 195 - if (IS_ERR(phy)) { 196 - ret = PTR_ERR(phy); 197 - dev_err(dev, "Failed to create MIPI D-PHY: %d\n", ret); 198 - return ret; 199 - } 192 + if (IS_ERR(phy)) 193 + return dev_err_probe(dev, PTR_ERR(phy), "Failed to create MIPI D-PHY\n"); 194 + 200 195 phy_set_drvdata(phy, mipi_tx); 201 196 202 197 phy_provider = devm_of_phy_provider_register(dev, of_phy_simple_xlate);