Skip to content

Commit 1bc7bb8

Browse files
andy-shevAndi Shyti
authored andcommitted
i2c: designware: Unify the firmware type checks
Instead of asymmetrical checks for the firmware type use the is_*_node() calls. Reviewed-by: Andi Shyti <[email protected]> Reviewed-by: Mario Limonciello <[email protected]> Signed-off-by: Andy Shevchenko <[email protected]> Signed-off-by: Andi Shyti <[email protected]>
1 parent ebe508e commit 1bc7bb8

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
#include <linux/module.h>
2323
#include <linux/of.h>
2424
#include <linux/pm_runtime.h>
25+
#include <linux/property.h>
2526
#include <linux/regmap.h>
2627
#include <linux/swab.h>
2728
#include <linux/types.h>
@@ -372,14 +373,15 @@ int i2c_dw_fw_parse_and_configure(struct dw_i2c_dev *dev)
372373
{
373374
struct i2c_timings *t = &dev->timings;
374375
struct device *device = dev->dev;
376+
struct fwnode_handle *fwnode = dev_fwnode(device);
375377

376378
i2c_parse_fw_timings(device, t, false);
377379

378380
i2c_dw_adjust_bus_speed(dev);
379381

380-
if (device->of_node)
382+
if (is_of_node(fwnode))
381383
i2c_dw_of_configure(device);
382-
if (has_acpi_companion(device))
384+
else if (is_acpi_node(fwnode))
383385
i2c_dw_acpi_configure(device);
384386

385387
return i2c_dw_validate_speed(dev);

0 commit comments

Comments
 (0)