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>
#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>
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)
#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
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;
#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>
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;