.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
---|
1 | 2 | /* |
---|
2 | 3 | * Copyright (C) 2007-2009 Luca Tettamanti <kronos.it@gmail.com> |
---|
3 | 4 | * |
---|
4 | | - * This file is released under the GPLv2 |
---|
5 | 5 | * See COPYING in the top level directory of the kernel tree. |
---|
6 | 6 | */ |
---|
7 | 7 | |
---|
.. | .. |
---|
681 | 681 | return err; |
---|
682 | 682 | } |
---|
683 | 683 | |
---|
684 | | -DEFINE_SIMPLE_ATTRIBUTE(atk_debugfs_gitm, |
---|
685 | | - atk_debugfs_gitm_get, |
---|
686 | | - NULL, |
---|
687 | | - "0x%08llx\n"); |
---|
| 684 | +DEFINE_DEBUGFS_ATTRIBUTE(atk_debugfs_gitm, atk_debugfs_gitm_get, NULL, |
---|
| 685 | + "0x%08llx\n"); |
---|
688 | 686 | |
---|
689 | 687 | static int atk_acpi_print(char *buf, size_t sz, union acpi_object *obj) |
---|
690 | 688 | { |
---|
.. | .. |
---|
791 | 789 | static void atk_debugfs_init(struct atk_data *data) |
---|
792 | 790 | { |
---|
793 | 791 | struct dentry *d; |
---|
794 | | - struct dentry *f; |
---|
795 | 792 | |
---|
796 | 793 | data->debugfs.id = 0; |
---|
797 | 794 | |
---|
798 | 795 | d = debugfs_create_dir("asus_atk0110", NULL); |
---|
799 | | - if (!d || IS_ERR(d)) |
---|
800 | | - return; |
---|
801 | 796 | |
---|
802 | | - f = debugfs_create_x32("id", S_IRUSR | S_IWUSR, d, &data->debugfs.id); |
---|
803 | | - if (!f || IS_ERR(f)) |
---|
804 | | - goto cleanup; |
---|
805 | | - |
---|
806 | | - f = debugfs_create_file("gitm", S_IRUSR, d, data, |
---|
807 | | - &atk_debugfs_gitm); |
---|
808 | | - if (!f || IS_ERR(f)) |
---|
809 | | - goto cleanup; |
---|
810 | | - |
---|
811 | | - f = debugfs_create_file("ggrp", S_IRUSR, d, data, |
---|
812 | | - &atk_debugfs_ggrp_fops); |
---|
813 | | - if (!f || IS_ERR(f)) |
---|
814 | | - goto cleanup; |
---|
| 797 | + debugfs_create_x32("id", 0600, d, &data->debugfs.id); |
---|
| 798 | + debugfs_create_file_unsafe("gitm", 0400, d, data, &atk_debugfs_gitm); |
---|
| 799 | + debugfs_create_file("ggrp", 0400, d, data, &atk_debugfs_ggrp_fops); |
---|
815 | 800 | |
---|
816 | 801 | data->debugfs.root = d; |
---|
817 | | - |
---|
818 | | - return; |
---|
819 | | -cleanup: |
---|
820 | | - debugfs_remove_recursive(d); |
---|
821 | 802 | } |
---|
822 | 803 | |
---|
823 | 804 | static void atk_debugfs_cleanup(struct atk_data *data) |
---|
.. | .. |
---|
1210 | 1191 | data->hwmon_dev = hwmon_device_register_with_groups(dev, "atk0110", |
---|
1211 | 1192 | data, |
---|
1212 | 1193 | data->attr_groups); |
---|
1213 | | - if (IS_ERR(data->hwmon_dev)) |
---|
1214 | | - return PTR_ERR(data->hwmon_dev); |
---|
1215 | 1194 | |
---|
1216 | | - return 0; |
---|
| 1195 | + return PTR_ERR_OR_ZERO(data->hwmon_dev); |
---|
1217 | 1196 | } |
---|
1218 | 1197 | |
---|
1219 | 1198 | static int atk_probe_if(struct atk_data *data) |
---|