Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b8bbe335 authored by Su Hui's avatar Su Hui Committed by Greg Kroah-Hartman
Browse files

clk: si5341: fix an error code problem in si5341_output_clk_set_rate



[ Upstream commit 5607068ae5ab02c3ac9cabc6859d36e98004c341 ]

regmap_bulk_write() return zero or negative error code, return the value
of regmap_bulk_write() rather than '0'.

Fixes: 3044a860 ("clk: Add Si5341/Si5340 driver")
Acked-by: default avatarMike Looijmans <mike.looijmans@topic.nl>
Signed-off-by: default avatarSu Hui <suhui@nfschina.com>
Link: https://lore.kernel.org/r/20231101031633.996124-1-suhui@nfschina.com


Signed-off-by: default avatarStephen Boyd <sboyd@kernel.org>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 4810cce0
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -732,10 +732,8 @@ static int si5341_output_clk_set_rate(struct clk_hw *hw, unsigned long rate,
	r[0] = r_div ? (r_div & 0xff) : 1;
	r[1] = (r_div >> 8) & 0xff;
	r[2] = (r_div >> 16) & 0xff;
	err = regmap_bulk_write(output->data->regmap,
	return regmap_bulk_write(output->data->regmap,
			SI5341_OUT_R_REG(output), r, 3);

	return 0;
}

static int si5341_output_reparent(struct clk_si5341_output *output, u8 index)