Commit fac25d7a authored by Serge Semin's avatar Serge Semin Committed by Wolfram Sang

i2c: designware: Retrieve quirk flags as early as possible

Some platforms might need to activate the driver quirks at a very early
probe stage. For instance, Baikal-T1 System I2C doesn't need to map the
registers space as ones belong to the system controller. Instead it will
request the syscon regmap from the parental DT node. In order to be able
to do so let's retrieve the model flags right after the DW I2C private
data is created. While at it replace the or-assignment with just
assignment operator since or-ing is redundant at this stage.
Signed-off-by: default avatarSerge Semin <Sergey.Semin@baikalelectronics.ru>
Reviewed-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: default avatarWolfram Sang <wsa@kernel.org>
parent 0daede80
......@@ -124,6 +124,8 @@ static int dw_i2c_plat_probe(struct platform_device *pdev)
if (!dev)
return -ENOMEM;
dev->flags = (uintptr_t)device_get_match_data(&pdev->dev);
dev->base = devm_platform_ioremap_resource(pdev, 0);
if (IS_ERR(dev->base))
return PTR_ERR(dev->base);
......@@ -146,8 +148,6 @@ static int dw_i2c_plat_probe(struct platform_device *pdev)
i2c_dw_acpi_adjust_bus_speed(&pdev->dev);
dev->flags |= (uintptr_t)device_get_match_data(&pdev->dev);
if (pdev->dev.of_node)
dw_i2c_of_configure(pdev);
......
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