mirror of
https://github.com/lkl/linux.git
synced 2025-12-19 16:13:19 +09:00
mtd: ubi: block: wire-up device parent
ubiblock devices were previously only identifyable by their name, but not connected to their parent UBI volume device e.g. in sysfs. Properly parent ubiblock device as descendant of a UBI volume device to reflect device model hierachy. Signed-off-by: Daniel Golle <daniel@makrotopia.org> Signed-off-by: Richard Weinberger <richard@nod.at>
This commit is contained in:
committed by
Richard Weinberger
parent
1ecf9e3904
commit
05b8773ca3
@@ -419,7 +419,7 @@ int ubiblock_create(struct ubi_volume_info *vi)
|
|||||||
list_add_tail(&dev->list, &ubiblock_devices);
|
list_add_tail(&dev->list, &ubiblock_devices);
|
||||||
|
|
||||||
/* Must be the last step: anyone can call file ops from now on */
|
/* Must be the last step: anyone can call file ops from now on */
|
||||||
ret = add_disk(dev->gd);
|
ret = device_add_disk(vi->dev, dev->gd, NULL);
|
||||||
if (ret)
|
if (ret)
|
||||||
goto out_remove_minor;
|
goto out_remove_minor;
|
||||||
|
|
||||||
|
|||||||
@@ -79,6 +79,7 @@ void ubi_do_get_volume_info(struct ubi_device *ubi, struct ubi_volume *vol,
|
|||||||
vi->name_len = vol->name_len;
|
vi->name_len = vol->name_len;
|
||||||
vi->name = vol->name;
|
vi->name = vol->name;
|
||||||
vi->cdev = vol->cdev.dev;
|
vi->cdev = vol->cdev.dev;
|
||||||
|
vi->dev = &vol->dev;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -110,6 +110,7 @@ struct ubi_volume_info {
|
|||||||
int name_len;
|
int name_len;
|
||||||
const char *name;
|
const char *name;
|
||||||
dev_t cdev;
|
dev_t cdev;
|
||||||
|
struct device *dev;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user