static int adc_vdd_platdata_set(struct udevice *dev)
{
struct adc_uclass_platdata *uc_pdata = dev_get_uclass_platdata(dev);
- int ret, offset = dev_of_offset(dev);
- const void *fdt = gd->fdt_blob;
+ int ret;
char *prop;
prop = "vdd-polarity-negative";
- uc_pdata->vdd_polarity_negative = fdtdec_get_bool(fdt, offset, prop);
+ uc_pdata->vdd_polarity_negative = dev_read_bool(dev, prop);
ret = adc_vdd_platdata_update(dev);
if (ret != -ENOENT)
/* No vdd-supply phandle. */
prop = "vdd-microvolts";
- uc_pdata->vdd_microvolts = fdtdec_get_int(fdt, offset, prop, -ENODATA);
+ uc_pdata->vdd_microvolts = dev_read_u32_default(dev, prop, -ENODATA);
return 0;
}
static int adc_vss_platdata_set(struct udevice *dev)
{
struct adc_uclass_platdata *uc_pdata = dev_get_uclass_platdata(dev);
- int ret, offset = dev_of_offset(dev);
- const void *fdt = gd->fdt_blob;
+ int ret;
char *prop;
prop = "vss-polarity-negative";
- uc_pdata->vss_polarity_negative = fdtdec_get_bool(fdt, offset, prop);
+ uc_pdata->vss_polarity_negative = dev_read_bool(dev, prop);
ret = adc_vss_platdata_update(dev);
if (ret != -ENOENT)
/* No vss-supply phandle. */
prop = "vss-microvolts";
- uc_pdata->vss_microvolts = fdtdec_get_int(fdt, offset, prop, -ENODATA);
+ uc_pdata->vss_microvolts = dev_read_u32_default(dev, prop, -ENODATA);
return 0;
}