1 From 227c693741ce1fbf0ad146c87f03369334941f2e Mon Sep 17 00:00:00 2001
2 From: Stuart Yoder <stuart.yoder@nxp.com>
3 Date: Wed, 22 Jun 2016 16:40:42 -0500
4 Subject: [PATCH 179/226] staging: fsl-mc: add support for the modalias sysfs
7 In order to support uevent based module loading implement modalias support
8 for the fsl-mc bus driver. Aliases are based on vendor and object/device
9 id and are of the form "fsl-mc:vNdN".
11 Signed-off-by: Stuart Yoder <stuart.yoder@nxp.com>
12 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
14 drivers/staging/fsl-mc/bus/mc-bus.c | 25 +++++++++++++++++++++++++
15 1 file changed, 25 insertions(+)
17 --- a/drivers/staging/fsl-mc/bus/mc-bus.c
18 +++ b/drivers/staging/fsl-mc/bus/mc-bus.c
19 @@ -82,10 +82,35 @@ static int fsl_mc_bus_uevent(struct devi
23 +static ssize_t modalias_show(struct device *dev, struct device_attribute *attr,
26 + struct fsl_mc_device *mc_dev = to_fsl_mc_device(dev);
28 + return sprintf(buf, "fsl-mc:v%08Xd%s\n", mc_dev->obj_desc.vendor,
29 + mc_dev->obj_desc.type);
31 +static DEVICE_ATTR_RO(modalias);
33 +static struct attribute *fsl_mc_dev_attrs[] = {
34 + &dev_attr_modalias.attr,
38 +static const struct attribute_group fsl_mc_dev_group = {
39 + .attrs = fsl_mc_dev_attrs,
42 +static const struct attribute_group *fsl_mc_dev_groups[] = {
47 struct bus_type fsl_mc_bus_type = {
49 .match = fsl_mc_bus_match,
50 .uevent = fsl_mc_bus_uevent,
51 + .dev_groups = fsl_mc_dev_groups,
53 EXPORT_SYMBOL_GPL(fsl_mc_bus_type);