[PATCH v4 2/9] driver: sysfs: do not pass cell name to jh_sysfs_cell_create

2 views
Skip to first unread message

Ralf Ramsauer

unread,
Aug 22, 2016, 11:39:39 AM8/22/16
to Jailhouse, Jan Kiszka, Ralf Ramsauer
struct cell now has information about the cell name. It is not necessary
to pass the name of the cell to jh_sysfs_cell_create.

Signed-off-by: Ralf Ramsauer <ra...@ramses-pyramidenbau.de>

diff --git a/driver/cell.c b/driver/cell.c
index 3cccf80..06e2b7f 100644
--- a/driver/cell.c
+++ b/driver/cell.c
@@ -77,7 +77,7 @@ static struct cell *cell_create(const struct jailhouse_cell_desc *cell_desc)
return ERR_PTR(err);
}

- err = jailhouse_sysfs_cell_create(cell, cell_desc->name);
+ err = jailhouse_sysfs_cell_create(cell);
if (err)
/* cleanup done by jailhouse_sysfs_cell_create */
return ERR_PTR(err);
diff --git a/driver/sysfs.c b/driver/sysfs.c
index 4959b56..a18c2b9 100644
--- a/driver/sysfs.c
+++ b/driver/sysfs.c
@@ -232,12 +232,12 @@ static struct kobj_type cell_type = {
.default_attrs = cell_attrs,
};

-int jailhouse_sysfs_cell_create(struct cell *cell, const char *name)
+int jailhouse_sysfs_cell_create(struct cell *cell)
{
int err;

err = kobject_init_and_add(&cell->kobj, &cell_type, cells_dir, "%s",
- name);
+ cell->name);
if (err) {
jailhouse_cell_kobj_release(&cell->kobj);
return err;
diff --git a/driver/sysfs.h b/driver/sysfs.h
index ad0e2f9..f5cdc34 100644
--- a/driver/sysfs.h
+++ b/driver/sysfs.h
@@ -15,7 +15,7 @@

#include <linux/device.h>

-int jailhouse_sysfs_cell_create(struct cell *cell, const char *name);
+int jailhouse_sysfs_cell_create(struct cell *cell);
void jailhouse_sysfs_cell_register(struct cell *cell);
void jailhouse_sysfs_cell_delete(struct cell *cell);

--
2.9.3

Reply all
Reply to author
Forward
0 new messages