diff options
author | Rob Herring <robh@kernel.org> | 2023-10-17 22:35:06 +0200 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2023-10-17 22:38:46 +0200 |
commit | a8b4962fbd004d7d4fcbf01ce7dc27fcef406199 (patch) | |
tree | b4b10dcb18ec0c77e9cde100b32e9277cc7be6d3 /drivers/regulator/tps51632-regulator.c | |
parent | regulator: da9063: Annotate struct da9063_regulators with __counted_by (diff) | |
download | linux-a8b4962fbd004d7d4fcbf01ce7dc27fcef406199.tar.xz linux-a8b4962fbd004d7d4fcbf01ce7dc27fcef406199.zip |
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/tps51632-regulator.c')
-rw-r--r-- | drivers/regulator/tps51632-regulator.c | 11 |
1 files changed, 0 insertions, 11 deletions
diff --git a/drivers/regulator/tps51632-regulator.c b/drivers/regulator/tps51632-regulator.c index d8a856c1587a..5199e0437388 100644 --- a/drivers/regulator/tps51632-regulator.c +++ b/drivers/regulator/tps51632-regulator.c @@ -16,7 +16,6 @@ #include <linux/kernel.h> #include <linux/module.h> #include <linux/of.h> -#include <linux/of_device.h> #include <linux/platform_device.h> #include <linux/regmap.h> #include <linux/regulator/driver.h> @@ -255,16 +254,6 @@ static int tps51632_probe(struct i2c_client *client) int ret; struct regulator_config config = { }; - if (client->dev.of_node) { - const struct of_device_id *match; - match = of_match_device(of_match_ptr(tps51632_of_match), - &client->dev); - if (!match) { - dev_err(&client->dev, "Error: No device match found\n"); - return -ENODEV; - } - } - tps = devm_kzalloc(&client->dev, sizeof(*tps), GFP_KERNEL); if (!tps) return -ENOMEM; |