Skip to content

Commit 2267d5a

Browse files
Ma Kedamien-lemoal
authored andcommitted
ata: sata_mv: aspeed: fix value check in mv_platform_probe()
In mv_platform_probe(), check the return value of clk_prepare_enable() and return the error code if clk_prepare_enable() returns an unexpected value. Signed-off-by: Ma Ke <make_ruc2021@163.com> Reviewed-by: Niklas Cassel <niklas.cassel@wdc.com> Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
1 parent b8b8b4e commit 2267d5a

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

drivers/ata/sata_mv.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4123,10 +4123,13 @@ static int mv_platform_probe(struct platform_device *pdev)
41234123
hpriv->base -= SATAHC0_REG_BASE;
41244124

41254125
hpriv->clk = clk_get(&pdev->dev, NULL);
4126-
if (IS_ERR(hpriv->clk))
4126+
if (IS_ERR(hpriv->clk)) {
41274127
dev_notice(&pdev->dev, "cannot get optional clkdev\n");
4128-
else
4129-
clk_prepare_enable(hpriv->clk);
4128+
} else {
4129+
rc = clk_prepare_enable(hpriv->clk);
4130+
if (rc)
4131+
goto err;
4132+
}
41304133

41314134
for (port = 0; port < n_ports; port++) {
41324135
char port_number[16];

0 commit comments

Comments
 (0)