Commit 85dd9268 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman
Browse files

xenbus: convert bus code to use dev_groups



The dev_attrs field of struct bus_type is going away soon, dev_groups
should be used instead.  This converts the xenbus code to use the
correct field.

Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Acked-by: default avatarBoris Ostrovsky <boris.ostrovsky@oracle.com>
Cc: David Vrabel <david.vrabel@citrix.com>
Cc: <xen-devel@lists.xenproject.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 4e9072d6
Loading
Loading
Loading
Loading
+18 −6
Original line number Original line Diff line number Diff line
@@ -384,12 +384,14 @@ static ssize_t nodename_show(struct device *dev,
{
{
	return sprintf(buf, "%s\n", to_xenbus_device(dev)->nodename);
	return sprintf(buf, "%s\n", to_xenbus_device(dev)->nodename);
}
}
static DEVICE_ATTR_RO(nodename);


static ssize_t devtype_show(struct device *dev,
static ssize_t devtype_show(struct device *dev,
			    struct device_attribute *attr, char *buf)
			    struct device_attribute *attr, char *buf)
{
{
	return sprintf(buf, "%s\n", to_xenbus_device(dev)->devicetype);
	return sprintf(buf, "%s\n", to_xenbus_device(dev)->devicetype);
}
}
static DEVICE_ATTR_RO(devtype);


static ssize_t modalias_show(struct device *dev,
static ssize_t modalias_show(struct device *dev,
			     struct device_attribute *attr, char *buf)
			     struct device_attribute *attr, char *buf)
@@ -397,14 +399,24 @@ static ssize_t modalias_show(struct device *dev,
	return sprintf(buf, "%s:%s\n", dev->bus->name,
	return sprintf(buf, "%s:%s\n", dev->bus->name,
		       to_xenbus_device(dev)->devicetype);
		       to_xenbus_device(dev)->devicetype);
}
}
static DEVICE_ATTR_RO(modalias);


struct device_attribute xenbus_dev_attrs[] = {
static struct attribute *xenbus_dev_attrs[] = {
	__ATTR_RO(nodename),
	&dev_attr_nodename.attr,
	__ATTR_RO(devtype),
	&dev_attr_devtype.attr,
	__ATTR_RO(modalias),
	&dev_attr_modalias.attr,
	__ATTR_NULL
	NULL,
};
};
EXPORT_SYMBOL_GPL(xenbus_dev_attrs);

static const struct attribute_group xenbus_dev_group = {
	.attrs = xenbus_dev_attrs,
};

const struct attribute_group *xenbus_dev_groups[] = {
	&xenbus_dev_group,
	NULL,
};
EXPORT_SYMBOL_GPL(xenbus_dev_groups);


int xenbus_probe_node(struct xen_bus_type *bus,
int xenbus_probe_node(struct xen_bus_type *bus,
		      const char *type,
		      const char *type,
+1 −1
Original line number Original line Diff line number Diff line
@@ -54,7 +54,7 @@ enum xenstore_init {
	XS_LOCAL,
	XS_LOCAL,
};
};


extern struct device_attribute xenbus_dev_attrs[];
extern const struct attribute_group *xenbus_dev_groups[];


extern int xenbus_match(struct device *_dev, struct device_driver *_drv);
extern int xenbus_match(struct device *_dev, struct device_driver *_drv);
extern int xenbus_dev_probe(struct device *_dev);
extern int xenbus_dev_probe(struct device *_dev);
+1 −1
Original line number Original line Diff line number Diff line
@@ -200,7 +200,7 @@ static struct xen_bus_type xenbus_backend = {
		.probe		= xenbus_dev_probe,
		.probe		= xenbus_dev_probe,
		.remove		= xenbus_dev_remove,
		.remove		= xenbus_dev_remove,
		.shutdown	= xenbus_dev_shutdown,
		.shutdown	= xenbus_dev_shutdown,
		.dev_attrs	= xenbus_dev_attrs,
		.dev_groups	= xenbus_dev_groups,
	},
	},
};
};


+1 −1
Original line number Original line Diff line number Diff line
@@ -154,7 +154,7 @@ static struct xen_bus_type xenbus_frontend = {
		.probe		= xenbus_frontend_dev_probe,
		.probe		= xenbus_frontend_dev_probe,
		.remove		= xenbus_dev_remove,
		.remove		= xenbus_dev_remove,
		.shutdown	= xenbus_dev_shutdown,
		.shutdown	= xenbus_dev_shutdown,
		.dev_attrs	= xenbus_dev_attrs,
		.dev_groups	= xenbus_dev_groups,


		.pm		= &xenbus_pm_ops,
		.pm		= &xenbus_pm_ops,
	},
	},