diff options
author | Rob Herring <robh@kernel.org> | 2023-10-17 23:35:06 +0300 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2023-10-17 23:38:46 +0300 |
commit | a8b4962fbd004d7d4fcbf01ce7dc27fcef406199 (patch) | |
tree | b4b10dcb18ec0c77e9cde100b32e9277cc7be6d3 /drivers/regulator/max1586.c | |
parent | 1096f9fa2be18a1340d1299b4c4329af211076e7 (diff) | |
download | linux-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/max1586.c')
-rw-r--r-- | drivers/regulator/max1586.c | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/drivers/regulator/max1586.c b/drivers/regulator/max1586.c index 90aa5b723c03..0f133129252e 100644 --- a/drivers/regulator/max1586.c +++ b/drivers/regulator/max1586.c @@ -11,7 +11,7 @@ #include <linux/regulator/driver.h> #include <linux/slab.h> #include <linux/regulator/max1586.h> -#include <linux/of_device.h> +#include <linux/of.h> #include <linux/regulator/of_regulator.h> #define MAX1586_V3_MAX_VSEL 31 @@ -213,16 +213,9 @@ static int max1586_pmic_probe(struct i2c_client *client) struct regulator_config config = { }; struct max1586_data *max1586; int i, id, ret; - const struct of_device_id *match; pdata = dev_get_platdata(&client->dev); if (client->dev.of_node && !pdata) { - match = of_match_device(of_match_ptr(max1586_of_match), - &client->dev); - if (!match) { - dev_err(&client->dev, "Error: No device match found\n"); - return -ENODEV; - } ret = of_get_max1586_platform_data(&client->dev, &pdata_of); if (ret < 0) return ret; |