Commit 8210ee60 authored by Federico Vaga's avatar Federico Vaga

move device_type definition from sysfs.c to objects.c

Signed-off-by: 's avatarFederico Vaga <federico.vaga@gmail.com>
Acked-by: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
parent f48b702d
......@@ -17,6 +17,51 @@
static struct zio_status *zstat = &zio_global_status; /* Always use ptr */
/* Device types */
void zio_device_release(struct device *dev)
{
pr_debug("RELEASE %s\n", dev_name(dev));
return;
}
void __zio_generic_device_release(struct device *dev)
{
pr_debug("RELEASE %s\n", dev_name(dev));
return;
}
struct device_type zdevhw_device_type = {
.name = zdevhw_device_type_name,
.release = __zio_generic_device_release,
};
struct device_type zdev_device_type = {
.name = zdev_device_type_name,
.release = zio_device_release,
.groups = def_zdev_groups_ptr,
};
struct device_type cset_device_type = {
.name = cset_device_type_name,
.release = zio_device_release,
.groups = def_cset_groups_ptr,
};
struct device_type chan_device_type = {
.name = chan_device_type_name,
.release = zio_device_release,
.groups = def_chan_groups_ptr,
};
struct device_type ti_device_type = {
.name = ti_device_type_name,
.release = zio_device_release,
.groups = def_ti_groups_ptr,
};
struct device_type bi_device_type = {
.name = bi_device_type_name,
.release = zio_device_release,
.groups = def_bi_groups_ptr,
};
/*
* Top-level ZIO objects has a unique name.
* You can find a particular object by searching its name.
......
......@@ -799,77 +799,36 @@ static const struct attribute_group zio_groups[] = {
},
};
/* default groups for whole-device */
static const struct attribute_group *def_zdev_groups_ptr[] = {
const struct attribute_group *def_zdev_groups_ptr[] = {
&zio_groups[ZIO_DAG_ALL],
&zio_groups[ZIO_DAG_HIE],
NULL,
};
/* default groups for channel set */
static const struct attribute_group *def_cset_groups_ptr[] = {
const struct attribute_group *def_cset_groups_ptr[] = {
&zio_groups[ZIO_DAG_ALL],
&zio_groups[ZIO_DAG_CSET],
&zio_groups[ZIO_DAG_HIE],
NULL,
};
/* default groups for channel */
static const struct attribute_group *def_chan_groups_ptr[] = {
const struct attribute_group *def_chan_groups_ptr[] = {
&zio_groups[ZIO_DAG_ALL],
&zio_groups[ZIO_DAG_CHAN],
&zio_groups[ZIO_DAG_HIE],
NULL,
};
/* default groups for trigger instance */
static const struct attribute_group *def_ti_groups_ptr[] = {
const struct attribute_group *def_ti_groups_ptr[] = {
&zio_groups[ZIO_DAG_ALL],
NULL,
};
/* default groups for buffer instance */
static const struct attribute_group *def_bi_groups_ptr[] = {
const struct attribute_group *def_bi_groups_ptr[] = {
&zio_groups[ZIO_DAG_BI],
NULL,
};
/* Device types */
void zio_device_release(struct device *dev)
{
pr_debug("RELEASE %s\n", dev_name(dev));
return;
}
void __zio_generic_device_release(struct device *dev)
{
pr_debug("RELEASE %s\n", dev_name(dev));
return;
}
struct device_type zdevhw_device_type = {
.name = zdevhw_device_type_name,
.release = __zio_generic_device_release,
};
struct device_type zdev_device_type = {
.name = zdev_device_type_name,
.release = zio_device_release,
.groups = def_zdev_groups_ptr,
};
struct device_type cset_device_type = {
.name = cset_device_type_name,
.release = zio_device_release,
.groups = def_cset_groups_ptr,
};
struct device_type chan_device_type = {
.name = chan_device_type_name,
.release = zio_device_release,
.groups = def_chan_groups_ptr,
};
struct device_type ti_device_type = {
.name = ti_device_type_name,
.release = zio_device_release,
.groups = def_ti_groups_ptr,
};
struct device_type bi_device_type = {
.name = bi_device_type_name,
.release = zio_device_release,
.groups = def_bi_groups_ptr,
};
static ssize_t zio_show_attr_version(struct device *dev,
struct device_attribute *attr,
......
......@@ -10,13 +10,15 @@
#endif
/* Defined in sysfs.c */
extern const struct attribute_group *def_zdev_groups_ptr[];
extern const struct attribute_group *def_cset_groups_ptr[];
extern const struct attribute_group *def_chan_groups_ptr[];
extern const struct attribute_group *def_ti_groups_ptr[];
extern const struct attribute_group *def_bi_groups_ptr[];
extern struct bin_attribute zio_bin_attr[];
/* Defined in object.c, used also in bus.c */
extern struct device_type zdevhw_device_type;
extern struct device_type zdev_device_type;
extern struct device_type cset_device_type;
extern struct device_type chan_device_type;
extern struct device_type ti_device_type;
extern struct device_type bi_device_type;
extern struct bin_attribute zio_bin_attr[];
/* This list is used in the core to keep track of registered objects */
struct zio_object_list {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment