usb-ctrl: factor and simplify quoting, reorder interface_type

The function name in sysfs was assembled several times when configuring
a mass storage device.  Change usb_set_interface_type to not expect the
path to have a trailing slash.  Consolidate the function name to one
variable and use it.

Quote complete strings instead of individual variables reducing the
number of quotes needed.  Quotes are not required when a safe string is
assigned within the script.

Also set filename after calling usb_set_iterface_type which may help
some cases (read-only files on read-only device type?).

Change-Id: I6c070957b1b9b36693af5717566d9bb13e93269d
Signed-off-by: Milton Miller <miltonm@us.ibm.com>
1 file changed
tree: 89bd2452016bffe2bd06c8fcc0a1d7140ab3b6ba
  1. firstboot/
  2. http-redirect/
  3. usb-ctrl/
  4. .gitignore
  5. LICENSE
  6. meson.build
  7. meson_options.txt
  8. README.md
README.md

phosphor-misc

phosphor-misc is a collection of miscellaneous OpenBMC functions that doesn't really fit anywhere else.

Contributing

If you have a new function in mind to be hosted in phosphor-misc, it is usually a good idea to mention it on the OpenBMC mailing list before writing any code. There might already be an implementation of the desired function or the community may suggest alternatives.

phosphor-misc patches are reviewed using the Gerrit instance at https://gerrit.openbmc-project.xyz.

Please submit patches to Gerrit. More information on using Gerrit can be found here. https://github.com/openbmc/phosphor-misc is a hosting mirror only and GitHub pull requests are not monitored and will not be accepted.

Patch checklist. Please ensure patches adhere to the following guidelines:

For questions or help please come join us on the mailing list or in IRC.