mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-23 08:35:19 -05:00
i2c: rcar: tidyup priv->devtype handling on rcar_i2c_probe()
rcar_i2c_probe() has priv->devtype operation, but handling (A) and (C) in same place is more understandable ( (A) and (B) are independent). (A) if (priv->devtype < I2C_RCAR_GEN3) { ... } (B) ... (C) if (priv->devtype >= I2C_RCAR_GEN3) { ... } Let's merge it with if-else Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be> Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
This commit is contained in:
parent
c9e8f5a553
commit
1bae758922
1 changed files with 5 additions and 7 deletions
|
@ -1164,11 +1164,6 @@ static int rcar_i2c_probe(struct platform_device *pdev)
|
|||
rcar_i2c_init(priv);
|
||||
rcar_i2c_reset_slave(priv);
|
||||
|
||||
if (priv->devtype < I2C_RCAR_GEN3) {
|
||||
irqflags |= IRQF_NO_THREAD;
|
||||
irqhandler = rcar_i2c_gen2_irq;
|
||||
}
|
||||
|
||||
/* Stay always active when multi-master to keep arbitration working */
|
||||
if (of_property_read_bool(dev->of_node, "multi-master"))
|
||||
priv->flags |= ID_P_PM_BLOCKED;
|
||||
|
@ -1178,8 +1173,11 @@ static int rcar_i2c_probe(struct platform_device *pdev)
|
|||
if (of_property_read_bool(dev->of_node, "smbus"))
|
||||
priv->flags |= ID_P_HOST_NOTIFY;
|
||||
|
||||
if (priv->devtype < I2C_RCAR_GEN3) {
|
||||
irqflags |= IRQF_NO_THREAD;
|
||||
irqhandler = rcar_i2c_gen2_irq;
|
||||
} else {
|
||||
/* R-Car Gen3+ needs a reset before every transfer */
|
||||
if (priv->devtype >= I2C_RCAR_GEN3) {
|
||||
priv->rstc = devm_reset_control_get_exclusive(&pdev->dev, NULL);
|
||||
if (IS_ERR(priv->rstc)) {
|
||||
ret = PTR_ERR(priv->rstc);
|
||||
|
|
Loading…
Add table
Reference in a new issue