static DEVICE_ATTR(calibrate, S_IWUSR, NULL, cyapa_calibrate_store);
 static DEVICE_ATTR(mode, S_IRUGO, cyapa_show_mode, NULL);
 
-static struct attribute *cyapa_sysfs_entries[] = {
+static struct attribute *cyapa_attrs[] = {
        &dev_attr_firmware_version.attr,
        &dev_attr_product_id.attr,
        &dev_attr_update_fw.attr,
        &dev_attr_mode.attr,
        NULL,
 };
-
-static const struct attribute_group cyapa_sysfs_group = {
-       .attrs = cyapa_sysfs_entries,
-};
+ATTRIBUTE_GROUPS(cyapa);
 
 static void cyapa_disable_regulator(void *data)
 {
                return error;
        }
 
-       error = devm_device_add_group(dev, &cyapa_sysfs_group);
-       if (error) {
-               dev_err(dev, "failed to create sysfs entries: %d\n", error);
-               return error;
-       }
-
        error = cyapa_prepare_wakeup_controls(cyapa);
        if (error) {
                dev_err(dev, "failed to prepare wakeup controls: %d\n", error);
 static struct i2c_driver cyapa_driver = {
        .driver = {
                .name = "cyapa",
+               .dev_groups = cyapa_groups,
                .pm = pm_ptr(&cyapa_pm_ops),
                .acpi_match_table = ACPI_PTR(cyapa_acpi_id),
                .of_match_table = of_match_ptr(cyapa_of_match),