Skip to content

Commit fac25d7

Browse files
fancerwsakernel
authored andcommitted
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: Serge Semin <Sergey.Semin@baikalelectronics.ru> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Wolfram Sang <wsa@kernel.org>
1 parent 0daede8 commit fac25d7

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

drivers/i2c/busses/i2c-designware-platdrv.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,8 @@ static int dw_i2c_plat_probe(struct platform_device *pdev)
124124
if (!dev)
125125
return -ENOMEM;
126126

127+
dev->flags = (uintptr_t)device_get_match_data(&pdev->dev);
128+
127129
dev->base = devm_platform_ioremap_resource(pdev, 0);
128130
if (IS_ERR(dev->base))
129131
return PTR_ERR(dev->base);
@@ -146,8 +148,6 @@ static int dw_i2c_plat_probe(struct platform_device *pdev)
146148

147149
i2c_dw_acpi_adjust_bus_speed(&pdev->dev);
148150

149-
dev->flags |= (uintptr_t)device_get_match_data(&pdev->dev);
150-
151151
if (pdev->dev.of_node)
152152
dw_i2c_of_configure(pdev);
153153

0 commit comments

Comments
 (0)