summaryrefslogtreecommitdiff
path: root/drivers/regulator/da9210-regulator.c
diff options
context:
space:
mode:
authorRob Herring <robh@kernel.org>2023-10-17 23:35:06 +0300
committerMark Brown <broonie@kernel.org>2023-10-17 23:38:46 +0300
commita8b4962fbd004d7d4fcbf01ce7dc27fcef406199 (patch)
treeb4b10dcb18ec0c77e9cde100b32e9277cc7be6d3 /drivers/regulator/da9210-regulator.c
parent1096f9fa2be18a1340d1299b4c4329af211076e7 (diff)
downloadlinux-a8b4962fbd004d7d4fcbf01ce7dc27fcef406199.tar.xz
regulator: Drop unnecessary of_match_device() calls
If probe is reached, we've already matched the device and in the case of DT matching, the struct device_node pointer will be set. Therefore, there is no need to call of_match_device() in probe. Signed-off-by: Rob Herring <robh@kernel.org> Link: https://lore.kernel.org/r/20231017203507.2699826-1-robh@kernel.org Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/regulator/da9210-regulator.c')
-rw-r--r--drivers/regulator/da9210-regulator.c12
1 files changed, 1 insertions, 11 deletions
diff --git a/drivers/regulator/da9210-regulator.c b/drivers/regulator/da9210-regulator.c
index 252f74ab9bc0..02b85ca4a6fc 100644
--- a/drivers/regulator/da9210-regulator.c
+++ b/drivers/regulator/da9210-regulator.c
@@ -10,7 +10,7 @@
#include <linux/irq.h>
#include <linux/regulator/driver.h>
#include <linux/regulator/machine.h>
-#include <linux/of_device.h>
+#include <linux/of.h>
#include <linux/regulator/of_regulator.h>
#include <linux/regmap.h>
@@ -135,16 +135,6 @@ static int da9210_i2c_probe(struct i2c_client *i2c)
struct regulator_dev *rdev = NULL;
struct regulator_config config = { };
int error;
- const struct of_device_id *match;
-
- if (i2c->dev.of_node && !pdata) {
- match = of_match_device(of_match_ptr(da9210_dt_ids),
- &i2c->dev);
- if (!match) {
- dev_err(&i2c->dev, "Error: No device match found\n");
- return -ENODEV;
- }
- }
chip = devm_kzalloc(&i2c->dev, sizeof(struct da9210), GFP_KERNEL);
if (!chip)