forked from luck/tmp_suning_uos_patched
gpio: use class_groups instead of class_attrs
The class_attrs pointer is long depreciated, and is about to be finally removed, so move to use the class_groups pointer instead. Acked-by: Linus Walleij <linus.walleij@linaro.org> Cc: Alexandre Courbot <gnurou@gmail.com> Cc: <linux-gpio@vger.kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
27104a53d0
commit
d83bb159f4
|
@ -479,6 +479,7 @@ static ssize_t export_store(struct class *class,
|
||||||
pr_debug("%s: status %d\n", __func__, status);
|
pr_debug("%s: status %d\n", __func__, status);
|
||||||
return status ? : len;
|
return status ? : len;
|
||||||
}
|
}
|
||||||
|
static CLASS_ATTR_WO(export);
|
||||||
|
|
||||||
static ssize_t unexport_store(struct class *class,
|
static ssize_t unexport_store(struct class *class,
|
||||||
struct class_attribute *attr,
|
struct class_attribute *attr,
|
||||||
|
@ -514,18 +515,20 @@ static ssize_t unexport_store(struct class *class,
|
||||||
pr_debug("%s: status %d\n", __func__, status);
|
pr_debug("%s: status %d\n", __func__, status);
|
||||||
return status ? : len;
|
return status ? : len;
|
||||||
}
|
}
|
||||||
|
static CLASS_ATTR_WO(unexport);
|
||||||
|
|
||||||
static struct class_attribute gpio_class_attrs[] = {
|
static struct attribute *gpio_class_attrs[] = {
|
||||||
__ATTR(export, 0200, NULL, export_store),
|
&class_attr_export.attr,
|
||||||
__ATTR(unexport, 0200, NULL, unexport_store),
|
&class_attr_unexport.attr,
|
||||||
__ATTR_NULL,
|
NULL,
|
||||||
};
|
};
|
||||||
|
ATTRIBUTE_GROUPS(gpio_class);
|
||||||
|
|
||||||
static struct class gpio_class = {
|
static struct class gpio_class = {
|
||||||
.name = "gpio",
|
.name = "gpio",
|
||||||
.owner = THIS_MODULE,
|
.owner = THIS_MODULE,
|
||||||
|
|
||||||
.class_attrs = gpio_class_attrs,
|
.class_groups = gpio_class_groups,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user