summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/cramfs/cramfs.c3
-rw-r--r--fs/devfs.c1
-rw-r--r--fs/fat/fat.c3
-rw-r--r--fs/fs.c5
-rw-r--r--fs/ramfs.c1
-rw-r--r--fs/tftp.c3
-rw-r--r--include/fs.h1
7 files changed, 6 insertions, 11 deletions
diff --git a/fs/cramfs/cramfs.c b/fs/cramfs/cramfs.c
index bdbb47ecf2..c7c798b238 100644
--- a/fs/cramfs/cramfs.c
+++ b/fs/cramfs/cramfs.c
@@ -423,7 +423,7 @@ static int cramfs_probe(struct device_d *dev)
struct fs_device_d *fsdev;
struct cramfs_priv *priv;
- fsdev = dev->type_data;
+ fsdev = dev_to_fs_device(dev);
priv = xmalloc(sizeof(struct cramfs_priv));
dev->priv = priv;
@@ -468,7 +468,6 @@ static struct fs_driver_d cramfs_driver = {
.probe = cramfs_probe,
.remove = cramfs_remove,
.name = "cramfs",
- .type_data = &cramfs_driver,
}
};
diff --git a/fs/devfs.c b/fs/devfs.c
index 2e70cc52fa..e3a21ae795 100644
--- a/fs/devfs.c
+++ b/fs/devfs.c
@@ -249,7 +249,6 @@ static struct fs_driver_d devfs_driver = {
.probe = devfs_probe,
.remove = devfs_delete,
.name = "devfs",
- .type_data = &devfs_driver,
}
};
diff --git a/fs/fat/fat.c b/fs/fat/fat.c
index 8420f3a097..7d6e37a6b0 100644
--- a/fs/fat/fat.c
+++ b/fs/fat/fat.c
@@ -373,7 +373,7 @@ static int fat_stat(struct device_d *dev, const char *filename, struct stat *s)
static int fat_probe(struct device_d *dev)
{
- struct fs_device_d *fsdev = dev->type_data;
+ struct fs_device_d *fsdev = dev_to_fs_device(dev);
struct fat_priv *priv = xzalloc(sizeof(struct fat_priv));
char *backingstore = fsdev->backingstore;
@@ -423,7 +423,6 @@ static struct fs_driver_d fat_driver = {
.probe = fat_probe,
.remove = fat_remove,
.name = "fat",
- .type_data = &fat_driver,
}
};
diff --git a/fs/fs.c b/fs/fs.c
index 0f12aa601f..a31a4ce260 100644
--- a/fs/fs.c
+++ b/fs/fs.c
@@ -704,7 +704,7 @@ static int fs_match(struct device_d *dev, struct driver_d *drv)
static int fs_probe(struct device_d *dev)
{
- struct fs_device_d *fsdev = container_of(dev, struct fs_device_d, dev);
+ struct fs_device_d *fsdev = dev_to_fs_device(dev);
struct mtab_entry *entry = &fsdev->mtab;
int ret;
@@ -729,7 +729,7 @@ static int fs_probe(struct device_d *dev)
static void fs_remove(struct device_d *dev)
{
- struct fs_device_d *fsdev = container_of(dev, struct fs_device_d, dev);
+ struct fs_device_d *fsdev = dev_to_fs_device(dev);
struct mtab_entry *entry = &fsdev->mtab;
if (fsdev->dev.driver) {
@@ -798,7 +798,6 @@ int mount(const char *device, const char *fsname, const char *_path)
fsdev = xzalloc(sizeof(struct fs_device_d));
fsdev->backingstore = xstrdup(device);
safe_strncpy(fsdev->dev.name, fsname, MAX_DRIVER_NAME);
- fsdev->dev.type_data = fsdev;
fsdev->dev.id = get_free_deviceid(fsdev->dev.name);
fsdev->mtab.path = xstrdup(path);
fsdev->dev.bus = &fs_bus;
diff --git a/fs/ramfs.c b/fs/ramfs.c
index 5e352f277a..83ab6dfc06 100644
--- a/fs/ramfs.c
+++ b/fs/ramfs.c
@@ -562,7 +562,6 @@ static struct fs_driver_d ramfs_driver = {
.probe = ramfs_probe,
.remove = ramfs_remove,
.name = "ramfs",
- .type_data = &ramfs_driver,
}
};
diff --git a/fs/tftp.c b/fs/tftp.c
index 512da0321d..463e0fc2d4 100644
--- a/fs/tftp.c
+++ b/fs/tftp.c
@@ -598,7 +598,7 @@ static int tftp_stat(struct device_d *dev, const char *filename, struct stat *s)
static int tftp_probe(struct device_d *dev)
{
- struct fs_device_d *fsdev = dev->type_data;
+ struct fs_device_d *fsdev = dev_to_fs_device(dev);
struct tftp_priv *priv = xzalloc(sizeof(struct tftp_priv));
dev->priv = priv;
@@ -633,7 +633,6 @@ static struct fs_driver_d tftp_driver = {
.probe = tftp_probe,
.remove = tftp_remove,
.name = "tftp",
- .type_data = &tftp_driver,
}
};
diff --git a/include/fs.h b/include/fs.h
index 5ef5f553d3..e5364f9e79 100644
--- a/include/fs.h
+++ b/include/fs.h
@@ -75,6 +75,7 @@ struct fs_driver_d {
};
#define dev_to_fs_driver(d) container_of(d->driver, struct fs_driver_d, drv)
+#define dev_to_fs_device(d) container_of(d, struct fs_device_d, dev)
struct mtab_entry {
char *path;