mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2025-03-04 21:45:03 +07:00
i2c: rcar: fix clk_get() error handling
When clk_get() fails, it returns an error code, not a NULL. This patch fixes such an error handling bug. Signed-off-by: Guennadi Liakhovetski <g.liakhovetski+renesas@gmail.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
This commit is contained in:
parent
7679c0e191
commit
330c824a49
@ -234,9 +234,9 @@ static int rcar_i2c_clock_calculate(struct rcar_i2c_priv *priv,
|
||||
u32 cdf_width;
|
||||
unsigned long rate;
|
||||
|
||||
if (!clkp) {
|
||||
dev_err(dev, "there is no peripheral_clk\n");
|
||||
return -EIO;
|
||||
if (IS_ERR(clkp)) {
|
||||
dev_err(dev, "couldn't get clock\n");
|
||||
return PTR_ERR(clkp);
|
||||
}
|
||||
|
||||
switch (priv->devtype) {
|
||||
|
Loading…
Reference in New Issue
Block a user