diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2016-05-21 07:12:25 +0300 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2016-05-21 07:12:25 +0300 |
commit | 19e36ad292ab24980db64a5ff17973d3118a8fb9 (patch) | |
tree | 175715409a689814e5cd425a98f2d2d47f82addf /drivers/usb/storage/sddr55.c | |
parent | e10abc629f38efd9b6936cf3612583cc846104d9 (diff) | |
parent | 60d5794fe5a50d02f4a0df84b45910a4dfa8b487 (diff) | |
download | linux-19e36ad292ab24980db64a5ff17973d3118a8fb9.tar.xz |
Merge tag 'usb-4.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb
Pull USB updates from Greg KH:
"Here's the big pull request for USB and PHY drivers for 4.7-rc1
Full details in the shortlog, but it's the normal major gadget driver
updates, phy updates, new usbip code, as well as a bit of lots of
other stuff.
All have been in linux-next with no reported issues"
* tag 'usb-4.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (164 commits)
USB: serial: ti_usb_3410_5052: add MOXA UPORT 11x0 support
USB: serial: fix minor-number allocation
USB: serial: quatech2: fix use-after-free in probe error path
USB: serial: mxuport: fix use-after-free in probe error path
USB: serial: keyspan: fix debug and error messages
USB: serial: keyspan: fix URB unlink
USB: serial: keyspan: fix use-after-free in probe error path
USB: serial: io_edgeport: fix memory leaks in probe error path
USB: serial: io_edgeport: fix memory leaks in attach error path
usb: Remove unnecessary space before operator ','.
usb: Remove unnecessary space before open square bracket.
USB: FHCI: avoid redundant condition
usb: host: xhci-rcar: Avoid long wait in xhci_reset()
usb/host/fotg210: remove dead code in create_sysfs_files
usb: wusbcore: Do not initialise statics to 0.
usb: wusbcore: Remove space before ',' and '(' .
USB: serial: cp210x: clean up CRTSCTS flag code
USB: serial: cp210x: get rid of magic numbers in CRTSCTS flag code
USB: serial: cp210x: fix hardware flow-control disable
USB: serial: option: add even more ZTE device ids
...
Diffstat (limited to 'drivers/usb/storage/sddr55.c')
-rw-r--r-- | drivers/usb/storage/sddr55.c | 45 |
1 files changed, 30 insertions, 15 deletions
diff --git a/drivers/usb/storage/sddr55.c b/drivers/usb/storage/sddr55.c index e5e0a25ecd96..147c50b3e00f 100644 --- a/drivers/usb/storage/sddr55.c +++ b/drivers/usb/storage/sddr55.c @@ -1,4 +1,5 @@ -/* Driver for SanDisk SDDR-55 SmartMedia reader +/* + * Driver for SanDisk SDDR-55 SmartMedia reader * * SDDR55 driver v0.1: * @@ -130,7 +131,8 @@ sddr55_bulk_transport(struct us_data *us, int direction, return usb_stor_bulk_transfer_buf(us, pipe, data, len, NULL); } -/* check if card inserted, if there is, update read_only status +/* + * check if card inserted, if there is, update read_only status * return non zero if no card */ @@ -714,15 +716,18 @@ static int sddr55_read_map(struct us_data *us) { if (max_lba > 1000) max_lba = 1000; - // Each block is 64 bytes of control data, so block i is located in - // scatterlist block i*64/128k = i*(2^6)*(2^-17) = i*(2^-11) + /* + * Each block is 64 bytes of control data, so block i is located in + * scatterlist block i*64/128k = i*(2^6)*(2^-17) = i*(2^-11) + */ for (i=0; i<numblocks; i++) { int zone = i / 1024; lba = short_pack(buffer[i * 2], buffer[i * 2 + 1]); - /* Every 1024 physical blocks ("zone"), the LBA numbers + /* + * Every 1024 physical blocks ("zone"), the LBA numbers * go back to zero, but are within a higher * block of LBA's. Also, there is a maximum of * 1000 LBA's per zone. In other words, in PBA @@ -733,7 +738,8 @@ static int sddr55_read_map(struct us_data *us) { * are 24 spare blocks to use when blocks do go bad. */ - /* SDDR55 returns 0xffff for a bad block, and 0x400 for the + /* + * SDDR55 returns 0xffff for a bad block, and 0x400 for the * CIS block. (Is this true for cards 8MB or less??) * Record these in the physical to logical map */ @@ -824,8 +830,10 @@ static int sddr55_transport(struct scsi_cmnd *srb, struct us_data *us) memset (info->sense_data, 0, sizeof info->sense_data); - /* Dummy up a response for INQUIRY since SDDR55 doesn't - respond to INQUIRY commands */ + /* + * Dummy up a response for INQUIRY since SDDR55 doesn't + * respond to INQUIRY commands + */ if (srb->cmnd[0] == INQUIRY) { memcpy(ptr, inquiry_response, 8); @@ -833,7 +841,8 @@ static int sddr55_transport(struct scsi_cmnd *srb, struct us_data *us) return USB_STOR_TRANSPORT_GOOD; } - /* only check card status if the map isn't allocated, ie no card seen yet + /* + * only check card status if the map isn't allocated, ie no card seen yet * or if it's been over half a second since we last accessed it */ if (info->lba_to_pba == NULL || time_after(jiffies, info->last_access + HZ/2)) { @@ -849,8 +858,10 @@ static int sddr55_transport(struct scsi_cmnd *srb, struct us_data *us) } } - /* if we detected a problem with the map when writing, - don't allow any more access */ + /* + * if we detected a problem with the map when writing, + * don't allow any more access + */ if (info->fatal_error) { set_sense_info (3, 0x31, 0); @@ -868,12 +879,16 @@ static int sddr55_transport(struct scsi_cmnd *srb, struct us_data *us) info->capacity = capacity; - /* figure out the maximum logical block number, allowing for - * the fact that only 250 out of every 256 are used */ + /* + * figure out the maximum logical block number, allowing for + * the fact that only 250 out of every 256 are used + */ info->max_log_blks = ((info->capacity >> (info->pageshift + info->blockshift)) / 256) * 250; - /* Last page in the card, adjust as we only use 250 out of - * every 256 pages */ + /* + * Last page in the card, adjust as we only use 250 out of + * every 256 pages + */ capacity = (capacity / 256) * 250; capacity /= PAGESIZE; |