diff options
author | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2024-08-22 20:58:39 +0300 |
---|---|---|
committer | Andi Shyti <andi.shyti@kernel.org> | 2024-09-10 00:36:40 +0200 |
commit | 1bc7bb89300f2adbcfdf30361d018ede43ca45f9 (patch) | |
tree | a2a05c3be613cc6dce2938b6b40e43fe89d6b93e /drivers/i2c/busses/i2c-designware-common.c | |
parent | ebe508e42226bd1503fcef076d6d76e81b9dd5f8 (diff) |
i2c: designware: Unify the firmware type checks
Instead of asymmetrical checks for the firmware type use
the is_*_node() calls.
Reviewed-by: Andi Shyti <andi.shyti@kernel.org>
Reviewed-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
Diffstat (limited to 'drivers/i2c/busses/i2c-designware-common.c')
-rw-r--r-- | drivers/i2c/busses/i2c-designware-common.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/i2c/busses/i2c-designware-common.c b/drivers/i2c/busses/i2c-designware-common.c index b0d3c47d93ce..2c460093b7ab 100644 --- a/drivers/i2c/busses/i2c-designware-common.c +++ b/drivers/i2c/busses/i2c-designware-common.c @@ -22,6 +22,7 @@ #include <linux/module.h> #include <linux/of.h> #include <linux/pm_runtime.h> +#include <linux/property.h> #include <linux/regmap.h> #include <linux/swab.h> #include <linux/types.h> @@ -372,14 +373,15 @@ int i2c_dw_fw_parse_and_configure(struct dw_i2c_dev *dev) { struct i2c_timings *t = &dev->timings; struct device *device = dev->dev; + struct fwnode_handle *fwnode = dev_fwnode(device); i2c_parse_fw_timings(device, t, false); i2c_dw_adjust_bus_speed(dev); - if (device->of_node) + if (is_of_node(fwnode)) i2c_dw_of_configure(device); - if (has_acpi_companion(device)) + else if (is_acpi_node(fwnode)) i2c_dw_acpi_configure(device); return i2c_dw_validate_speed(dev); |