| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Intel Wireless WiMAX Connection 2400m |
|---|
| 3 | 4 | * Generic probe/disconnect, reset and message passing |
|---|
| 4 | 5 | * |
|---|
| 5 | | - * |
|---|
| 6 | 6 | * Copyright (C) 2007-2008 Intel Corporation <linux-wimax@intel.com> |
|---|
| 7 | 7 | * Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com> |
|---|
| 8 | | - * |
|---|
| 9 | | - * This program is free software; you can redistribute it and/or |
|---|
| 10 | | - * modify it under the terms of the GNU General Public License version |
|---|
| 11 | | - * 2 as published by the Free Software Foundation. |
|---|
| 12 | | - * |
|---|
| 13 | | - * This program is distributed in the hope that it will be useful, |
|---|
| 14 | | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|---|
| 15 | | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|---|
| 16 | | - * GNU General Public License for more details. |
|---|
| 17 | | - * |
|---|
| 18 | | - * You should have received a copy of the GNU General Public License |
|---|
| 19 | | - * along with this program; if not, write to the Free Software |
|---|
| 20 | | - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA |
|---|
| 21 | | - * 02110-1301, USA. |
|---|
| 22 | | - * |
|---|
| 23 | 8 | * |
|---|
| 24 | 9 | * See i2400m.h for driver documentation. This contains helpers for |
|---|
| 25 | 10 | * the driver model glue [_setup()/_release()], handling device resets |
|---|
| .. | .. |
|---|
| 755 | 740 | static |
|---|
| 756 | 741 | int i2400m_bm_buf_alloc(struct i2400m *i2400m) |
|---|
| 757 | 742 | { |
|---|
| 758 | | - int result; |
|---|
| 759 | | - |
|---|
| 760 | | - result = -ENOMEM; |
|---|
| 761 | 743 | i2400m->bm_cmd_buf = kzalloc(I2400M_BM_CMD_BUF_SIZE, GFP_KERNEL); |
|---|
| 762 | 744 | if (i2400m->bm_cmd_buf == NULL) |
|---|
| 763 | 745 | goto error_bm_cmd_kzalloc; |
|---|
| .. | .. |
|---|
| 769 | 751 | error_bm_ack_buf_kzalloc: |
|---|
| 770 | 752 | kfree(i2400m->bm_cmd_buf); |
|---|
| 771 | 753 | error_bm_cmd_kzalloc: |
|---|
| 772 | | - return result; |
|---|
| 754 | + return -ENOMEM; |
|---|
| 773 | 755 | } |
|---|
| 774 | 756 | |
|---|
| 775 | 757 | |
|---|
| .. | .. |
|---|
| 858 | 840 | */ |
|---|
| 859 | 841 | int i2400m_setup(struct i2400m *i2400m, enum i2400m_bri bm_flags) |
|---|
| 860 | 842 | { |
|---|
| 861 | | - int result = -ENODEV; |
|---|
| 843 | + int result; |
|---|
| 862 | 844 | struct device *dev = i2400m_dev(i2400m); |
|---|
| 863 | 845 | struct wimax_dev *wimax_dev = &i2400m->wimax_dev; |
|---|
| 864 | 846 | struct net_device *net_dev = i2400m->wimax_dev.net_dev; |
|---|
| .. | .. |
|---|
| 920 | 902 | goto error_sysfs_setup; |
|---|
| 921 | 903 | } |
|---|
| 922 | 904 | |
|---|
| 923 | | - result = i2400m_debugfs_add(i2400m); |
|---|
| 924 | | - if (result < 0) { |
|---|
| 925 | | - dev_err(dev, "cannot setup i2400m's debugfs: %d\n", result); |
|---|
| 926 | | - goto error_debugfs_setup; |
|---|
| 927 | | - } |
|---|
| 905 | + i2400m_debugfs_add(i2400m); |
|---|
| 928 | 906 | |
|---|
| 929 | 907 | result = i2400m_dev_start(i2400m, bm_flags); |
|---|
| 930 | 908 | if (result < 0) |
|---|
| .. | .. |
|---|
| 934 | 912 | |
|---|
| 935 | 913 | error_dev_start: |
|---|
| 936 | 914 | i2400m_debugfs_rm(i2400m); |
|---|
| 937 | | -error_debugfs_setup: |
|---|
| 938 | 915 | sysfs_remove_group(&i2400m->wimax_dev.net_dev->dev.kobj, |
|---|
| 939 | 916 | &i2400m_dev_attr_group); |
|---|
| 940 | 917 | error_sysfs_setup: |
|---|