Re: [PATCH 13/16] hid: intel-ish-hid: use dev_groups and not dev_attrs for bus_type

From: Srinivas Pandruvada
Date: Tue Jun 06 2017 - 18:33:09 EST


On Tue, 2017-06-06 at 21:22 +0200, Greg Kroah-Hartman wrote:
> The dev_attrs field has long been "depreciated" and is finally being
> removed, so move the driver to use the "correct" dev_groups field
> instead for struct bus_type.
>
> Cc: Srinivas Pandruvada <srinivas.pandruvada@xxxxxxxxxxxxxxx>
> Cc: Jiri Kosina <jikos@xxxxxxxxxx>
> Cc: Benjamin Tissoires <benjamin.tissoires@xxxxxxxxxx>
> Cc: Wei Yongjun <weiyj.lk@xxxxxxxxx>
> Cc: Bhumika Goyal <bhumirks@xxxxxxxxx>
> Cc: Rasmus Villemoes <linux@xxxxxxxxxxxxxxxxxx>
> Cc: <linux-input@xxxxxxxxxxxxxxx>
> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
Acked-by: Srinivas Pandruvada <srinivas.pandruvada@xxxxxxxxxxxxxxx>

> ---
> Âdrivers/hid/intel-ish-hid/ishtp/bus.c | 10 ++++++----
> Â1 file changed, 6 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/hid/intel-ish-hid/ishtp/bus.c
> b/drivers/hid/intel-ish-hid/ishtp/bus.c
> index 5f382fedc2ab..f272cdd9bd55 100644
> --- a/drivers/hid/intel-ish-hid/ishtp/bus.c
> +++ b/drivers/hid/intel-ish-hid/ishtp/bus.c
> @@ -321,11 +321,13 @@ static ssize_t modalias_show(struct device
> *dev, struct device_attribute *a,
> Â len = snprintf(buf, PAGE_SIZE, "ishtp:%s\n", dev_name(dev));
> Â return (len >= PAGE_SIZE) ? (PAGE_SIZE - 1) : len;
> Â}
> +static DEVICE_ATTR_RO(modalias);
> Â
> -static struct device_attribute ishtp_cl_dev_attrs[] = {
> - __ATTR_RO(modalias),
> - __ATTR_NULL,
> +static struct attribute *ishtp_cl_dev_attrs[] = {
> + &dev_attr_modalias.attr,
> + NULL,
> Â};
> +ATTRIBUTE_GROUPS(ishtp_cl_dev);
> Â
> Âstatic int ishtp_cl_uevent(struct device *dev, struct
> kobj_uevent_env *env)
> Â{
> @@ -346,7 +348,7 @@ static const struct dev_pm_ops
> ishtp_cl_bus_dev_pm_ops = {
> Â
> Âstatic struct bus_type ishtp_cl_bus_type = {
> Â .name = "ishtp",
> - .dev_attrs = ishtp_cl_dev_attrs,
> + .dev_groups = ishtp_cl_dev_groups,
> Â .probe = ishtp_cl_device_probe,
> Â .remove = ishtp_cl_device_remove,
> Â .pm = &ishtp_cl_bus_dev_pm_ops,