static int get_major_minor(struct sysfs_class_device *class_dev, struct udevice *udev)
{
int retval = -ENODEV;
- char *dev;
+ struct sysfs_attribute *attr = NULL;
- dev = sysfs_get_value_from_attributes(class_dev->directory->attributes, "dev");
- if (dev == NULL)
+ attr = sysfs_get_classdev_attr(class_dev, "dev");
+ if (attr == NULL)
goto exit;
- dbg("dev='%s'", dev);
+ dbg("dev='%s'", attr->value);
- if (sscanf(dev, "%u:%u", &udev->major, &udev->minor) != 2)
+ if (sscanf(attr->value, "%u:%u", &udev->major, &udev->minor) != 2)
goto exit;
dbg("found major=%d, minor=%d", udev->major, udev->minor);
dbg("looking at '%s'", dev_path);
/* open up the sysfs class device for this thing... */
- class_dev = sysfs_open_class_device(dev_path);
+ class_dev = sysfs_open_class_device_path(dev_path);
if (class_dev == NULL) {
- dbg ("sysfs_open_class_device failed");
+ dbg ("sysfs_open_class_device_path failed");
goto exit;
}
dbg("class_dev->name='%s'", class_dev->name);