hc
2023-12-06 08f87f769b595151be1afeff53e144f543faa614
kernel/drivers/scsi/fcoe/fcoe_sysfs.c
....@@ -1,18 +1,6 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * Copyright(c) 2011 - 2012 Intel Corporation. All rights reserved.
3
- *
4
- * This program is free software; you can redistribute it and/or modify it
5
- * under the terms and conditions of the GNU General Public License,
6
- * version 2, as published by the Free Software Foundation.
7
- *
8
- * This program is distributed in the hope it will be useful, but WITHOUT
9
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
11
- * more details.
12
- *
13
- * You should have received a copy of the GNU General Public License along with
14
- * this program; if not, write to the Free Software Foundation, Inc.,
15
- * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
164 *
175 * Maintained at www.Open-FCoE.org
186 */
....@@ -671,8 +659,19 @@
671659 .release = fcoe_fcf_device_release,
672660 };
673661
674
-static BUS_ATTR(ctlr_create, S_IWUSR, NULL, fcoe_ctlr_create_store);
675
-static BUS_ATTR(ctlr_destroy, S_IWUSR, NULL, fcoe_ctlr_destroy_store);
662
+static ssize_t ctlr_create_store(struct bus_type *bus, const char *buf,
663
+ size_t count)
664
+{
665
+ return fcoe_ctlr_create_store(bus, buf, count);
666
+}
667
+static BUS_ATTR_WO(ctlr_create);
668
+
669
+static ssize_t ctlr_destroy_store(struct bus_type *bus, const char *buf,
670
+ size_t count)
671
+{
672
+ return fcoe_ctlr_destroy_store(bus, buf, count);
673
+}
674
+static BUS_ATTR_WO(ctlr_destroy);
676675
677676 static struct attribute *fcoe_bus_attrs[] = {
678677 &bus_attr_ctlr_create.attr,
....@@ -1054,16 +1053,10 @@
10541053
10551054 int __init fcoe_sysfs_setup(void)
10561055 {
1057
- int error;
1058
-
10591056 atomic_set(&ctlr_num, 0);
10601057 atomic_set(&fcf_num, 0);
10611058
1062
- error = bus_register(&fcoe_bus_type);
1063
- if (error)
1064
- return error;
1065
-
1066
- return 0;
1059
+ return bus_register(&fcoe_bus_type);
10671060 }
10681061
10691062 void __exit fcoe_sysfs_teardown(void)