Skip to content

Commit 1bae758

Browse files
morimotoAndi Shyti
authored andcommitted
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 <[email protected]> Reviewed-by: Geert Uytterhoeven <[email protected]> Reviewed-by: Wolfram Sang <[email protected]> Signed-off-by: Andi Shyti <[email protected]>
1 parent c9e8f5a commit 1bae758

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

drivers/i2c/busses/i2c-rcar.c

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1164,11 +1164,6 @@ static int rcar_i2c_probe(struct platform_device *pdev)
11641164
rcar_i2c_init(priv);
11651165
rcar_i2c_reset_slave(priv);
11661166

1167-
if (priv->devtype < I2C_RCAR_GEN3) {
1168-
irqflags |= IRQF_NO_THREAD;
1169-
irqhandler = rcar_i2c_gen2_irq;
1170-
}
1171-
11721167
/* Stay always active when multi-master to keep arbitration working */
11731168
if (of_property_read_bool(dev->of_node, "multi-master"))
11741169
priv->flags |= ID_P_PM_BLOCKED;
@@ -1178,8 +1173,11 @@ static int rcar_i2c_probe(struct platform_device *pdev)
11781173
if (of_property_read_bool(dev->of_node, "smbus"))
11791174
priv->flags |= ID_P_HOST_NOTIFY;
11801175

1181-
/* R-Car Gen3+ needs a reset before every transfer */
1182-
if (priv->devtype >= I2C_RCAR_GEN3) {
1176+
if (priv->devtype < I2C_RCAR_GEN3) {
1177+
irqflags |= IRQF_NO_THREAD;
1178+
irqhandler = rcar_i2c_gen2_irq;
1179+
} else {
1180+
/* R-Car Gen3+ needs a reset before every transfer */
11831181
priv->rstc = devm_reset_control_get_exclusive(&pdev->dev, NULL);
11841182
if (IS_ERR(priv->rstc)) {
11851183
ret = PTR_ERR(priv->rstc);

0 commit comments

Comments
 (0)