Skip to content

Commit 1a12af1

Browse files
mina86Felipe Balbi
authored andcommitted
usb: gadget: mass_storage: remove unused options
This commit removes thread_name and lun_name_format fields from the fsg_config structure. Those fields are not used by any in-tree code and their usefulness is rather theoretical. Signed-off-by: Michal Nazarewicz <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
1 parent 2b97fb5 commit 1a12af1

File tree

1 file changed

+10
-40
lines changed

1 file changed

+10
-40
lines changed

drivers/usb/gadget/f_mass_storage.c

Lines changed: 10 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -75,25 +75,6 @@
7575
* ->nofua Flag specifying that FUA flag in SCSI WRITE(10,12)
7676
* commands for this LUN shall be ignored.
7777
*
78-
* lun_name_format A printf-like format for names of the LUN
79-
* devices. This determines how the
80-
* directory in sysfs will be named.
81-
* Unless you are using several MSFs in
82-
* a single gadget (as opposed to single
83-
* MSF in many configurations) you may
84-
* leave it as NULL (in which case
85-
* "lun%d" will be used). In the format
86-
* you can use "%d" to index LUNs for
87-
* MSF's with more than one LUN. (Beware
88-
* that there is only one integer given
89-
* as an argument for the format and
90-
* specifying invalid format may cause
91-
* unspecified behaviour.)
92-
* thread_name Name of the kernel thread process used by the
93-
* MSF. You can safely set it to NULL
94-
* (in which case default "file-storage"
95-
* will be used).
96-
*
9778
* vendor_name
9879
* product_name
9980
* release Information used as a reply to INQUIRY
@@ -155,15 +136,14 @@
155136
* a buffer from being used by more than one endpoint.
156137
*
157138
*
158-
* The pathnames of the backing files and the ro settings are
159-
* available in the attribute files "file" and "ro" in the lun<n> (or
160-
* to be more precise in a directory which name comes from
161-
* "lun_name_format" option!) subdirectory of the gadget's sysfs
162-
* directory. If the "removable" option is set, writing to these
163-
* files will simulate ejecting/loading the medium (writing an empty
164-
* line means eject) and adjusting a write-enable tab. Changes to the
165-
* ro setting are not allowed when the medium is loaded or if CD-ROM
166-
* emulation is being used.
139+
* The pathnames of the backing files, the ro settings and nofua
140+
* settings are available in the attribute files "file", "ro" and
141+
* "nofua" in the lun<n> subdirectory of the gadget's sysfs directory.
142+
* If the "removable" option is set, writing to these files will
143+
* simulate ejecting/loading the medium (writing an empty line means
144+
* eject) and adjusting a write-enable tab. Changes to the ro setting
145+
* are not allowed when the medium is loaded or if CD-ROM emulation is
146+
* being used.
167147
*
168148
* When a LUN receive an "eject" SCSI request (Start/Stop Unit),
169149
* if the LUN is removable, the backing file is released to simulate
@@ -417,9 +397,6 @@ struct fsg_config {
417397
char nofua;
418398
} luns[FSG_MAX_LUNS];
419399

420-
const char *lun_name_format;
421-
const char *thread_name;
422-
423400
/* Callback functions. */
424401
const struct fsg_operations *ops;
425402
/* Gadget's private data. */
@@ -2792,11 +2769,7 @@ static struct fsg_common *fsg_common_init(struct fsg_common *common,
27922769
curlun->dev.parent = &gadget->dev;
27932770
/* curlun->dev.driver = &fsg_driver.driver; XXX */
27942771
dev_set_drvdata(&curlun->dev, &common->filesem);
2795-
dev_set_name(&curlun->dev,
2796-
cfg->lun_name_format
2797-
? cfg->lun_name_format
2798-
: "lun%d",
2799-
i);
2772+
dev_set_name(&curlun->dev, "lun%d", i);
28002773

28012774
rc = device_register(&curlun->dev);
28022775
if (rc) {
@@ -2878,8 +2851,7 @@ static struct fsg_common *fsg_common_init(struct fsg_common *common,
28782851

28792852
/* Tell the thread to start working */
28802853
common->thread_task =
2881-
kthread_create(fsg_main_thread, common,
2882-
cfg->thread_name ?: "file-storage");
2854+
kthread_create(fsg_main_thread, common, "file-storage");
28832855
if (IS_ERR(common->thread_task)) {
28842856
rc = PTR_ERR(common->thread_task);
28852857
goto error_release;
@@ -3175,8 +3147,6 @@ fsg_config_from_params(struct fsg_config *cfg,
31753147
}
31763148

31773149
/* Let MSF use defaults */
3178-
cfg->lun_name_format = 0;
3179-
cfg->thread_name = 0;
31803150
cfg->vendor_name = 0;
31813151
cfg->product_name = 0;
31823152
cfg->release = 0xffff;

0 commit comments

Comments
 (0)