static int fan53555_regulator_probe(struct i2c_client *client)
{
- const struct i2c_device_id *id = i2c_client_get_device_id(client);
struct device_node *np = client->dev.of_node;
struct fan53555_device_info *di;
struct fan53555_platform_data *pdata;
"Platform data not found!\n");
di->regulator = pdata->regulator;
- if (client->dev.of_node) {
- di->vendor =
- (unsigned long)of_device_get_match_data(&client->dev);
- } else {
+ di->vendor = (uintptr_t)i2c_get_match_data(client);
+ if (!dev_fwnode(&client->dev)) {
/* if no ramp constraint set, get the pdata ramp_delay */
if (!di->regulator->constraints.ramp_delay) {
if (pdata->slew_rate >= ARRAY_SIZE(slew_rates))
di->regulator->constraints.ramp_delay
= slew_rates[pdata->slew_rate];
}
-
- di->vendor = id->driver_data;
}
regmap = devm_regmap_init_i2c(client, &fan53555_regmap_config);