Commit 270282bd authored by Chris Packham's avatar Chris Packham Committed by Wolfram Sang

i2c: mpc: Remove redundant NULL check

In mpc_i2c_get_fdr_8xxx div is assigned as we iterate through the
mpc_i2c_dividers_8xxx array. By the time we exit the loop div will
either have the value that matches the requested speed or be pointing at
the last entry in mpc_i2c_dividers_8xxx. Checking for div being NULL
after the loop is redundant so remove the check.
Reported-by: default avatarWolfram Sang <wsa@kernel.org>
Signed-off-by: default avatarChris Packham <chris.packham@alliedtelesis.co.nz>
Signed-off-by: default avatarWolfram Sang <wsa@kernel.org>
parent 4aa3e48d
...@@ -399,7 +399,7 @@ static int mpc_i2c_get_fdr_8xxx(struct device_node *node, u32 clock, ...@@ -399,7 +399,7 @@ static int mpc_i2c_get_fdr_8xxx(struct device_node *node, u32 clock,
} }
*real_clk = fsl_get_sys_freq() / prescaler / div->divider; *real_clk = fsl_get_sys_freq() / prescaler / div->divider;
return div ? (int)div->fdr : -EINVAL; return (int)div->fdr;
} }
static void mpc_i2c_setup_8xxx(struct device_node *node, static void mpc_i2c_setup_8xxx(struct device_node *node,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment