drivers: usb: gadget: ether/rndis: convert driver to adopt device driver model
[oweals/u-boot.git] / drivers / usb / gadget / storage_common.c
index 74300746b9dbce36dc30fb261b55d0da26a6e780..b6df130a1405bc94328084f519de0c7fe56eda8f 100644 (file)
@@ -267,11 +267,6 @@ struct interrupt_data {
 #define ASCQ(x)                ((u8) (x))
 
 struct device_attribute { int i; };
-struct rw_semaphore { int i; };
-#define down_write(...)                        do { } while (0)
-#define up_write(...)                  do { } while (0)
-#define down_read(...)                 do { } while (0)
-#define up_read(...)                   do { } while (0)
 #define ETOOSMALL      525
 
 #include <usb_mass_storage.h>
@@ -311,11 +306,7 @@ static struct fsg_lun *fsg_lun_from_dev(struct device *dev)
 #define DELAYED_STATUS (EP0_BUFSIZE + 999)     /* An impossibly large value */
 
 /* Number of buffers we will use.  2 is enough for double-buffering */
-#ifndef CONFIG_CI_UDC
 #define FSG_NUM_BUFFERS        2
-#else
-#define FSG_NUM_BUFFERS        1 /* ci_udc only allows 1 req per ep at present */
-#endif
 
 /* Default size of buffer length. */
 #define FSG_BUFLEN     ((u32)16384)
@@ -573,7 +564,8 @@ static struct usb_gadget_strings    fsg_stringtab = {
  * the caller must own fsg->filesem for writing.
  */
 
-static int fsg_lun_open(struct fsg_lun *curlun, const char *filename)
+static int fsg_lun_open(struct fsg_lun *curlun, unsigned int num_sectors,
+                       const char *filename)
 {
        int                             ro;
 
@@ -581,8 +573,8 @@ static int fsg_lun_open(struct fsg_lun *curlun, const char *filename)
        ro = curlun->initially_ro;
 
        curlun->ro = ro;
-       curlun->file_length = ums->num_sectors << 9;
-       curlun->num_sectors = ums->num_sectors;
+       curlun->file_length = num_sectors << 9;
+       curlun->num_sectors = num_sectors;
        debug("open backing file: %s\n", filename);
 
        return 0;