diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/char/tty_port.c | 7 | ||||
-rw-r--r-- | drivers/crypto/padlock-aes.c | 4 | ||||
-rw-r--r-- | drivers/i2c/busses/i2c-pnx.c | 4 | ||||
-rw-r--r-- | drivers/i2c/chips/tsl2550.c | 3 | ||||
-rw-r--r-- | drivers/i2c/i2c-core.c | 11 | ||||
-rw-r--r-- | drivers/misc/eeprom/at24.c | 76 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-tx.c | 10 | ||||
-rw-r--r-- | drivers/scsi/hosts.c | 2 | ||||
-rw-r--r-- | drivers/scsi/scsi_scan.c | 18 | ||||
-rw-r--r-- | drivers/scsi/scsi_sysfs.c | 63 | ||||
-rw-r--r-- | drivers/scsi/sd_dif.c | 2 | ||||
-rw-r--r-- | drivers/serial/bcm63xx_uart.c | 4 | ||||
-rw-r--r-- | drivers/serial/of_serial.c | 1 | ||||
-rw-r--r-- | drivers/watchdog/pnx4008_wdt.c | 4 |
14 files changed, 115 insertions, 94 deletions
diff --git a/drivers/char/tty_port.c b/drivers/char/tty_port.c index 2e8552dc5eda..c63f3d33914a 100644 --- a/drivers/char/tty_port.c +++ b/drivers/char/tty_port.c | |||
@@ -219,8 +219,11 @@ int tty_port_block_til_ready(struct tty_port *port, | |||
219 | 219 | ||
220 | /* if non-blocking mode is set we can pass directly to open unless | 220 | /* if non-blocking mode is set we can pass directly to open unless |
221 | the port has just hung up or is in another error state */ | 221 | the port has just hung up or is in another error state */ |
222 | if ((filp->f_flags & O_NONBLOCK) || | 222 | if (tty->flags & (1 << TTY_IO_ERROR)) { |
223 | (tty->flags & (1 << TTY_IO_ERROR))) { | 223 | port->flags |= ASYNC_NORMAL_ACTIVE; |
224 | return 0; | ||
225 | } | ||
226 | if (filp->f_flags & O_NONBLOCK) { | ||
224 | /* Indicate we are open */ | 227 | /* Indicate we are open */ |
225 | if (tty->termios->c_cflag & CBAUD) | 228 | if (tty->termios->c_cflag & CBAUD) |
226 | tty_port_raise_dtr_rts(port); | 229 | tty_port_raise_dtr_rts(port); |
diff --git a/drivers/crypto/padlock-aes.c b/drivers/crypto/padlock-aes.c index a9952b1236b0..84c51e177269 100644 --- a/drivers/crypto/padlock-aes.c +++ b/drivers/crypto/padlock-aes.c | |||
@@ -236,7 +236,7 @@ static inline void ecb_crypt(const u8 *in, u8 *out, u32 *key, | |||
236 | /* Padlock in ECB mode fetches at least ecb_fetch_bytes of data. | 236 | /* Padlock in ECB mode fetches at least ecb_fetch_bytes of data. |
237 | * We could avoid some copying here but it's probably not worth it. | 237 | * We could avoid some copying here but it's probably not worth it. |
238 | */ | 238 | */ |
239 | if (unlikely(((unsigned long)in & PAGE_SIZE) + ecb_fetch_bytes > PAGE_SIZE)) { | 239 | if (unlikely(((unsigned long)in & ~PAGE_MASK) + ecb_fetch_bytes > PAGE_SIZE)) { |
240 | ecb_crypt_copy(in, out, key, cword, count); | 240 | ecb_crypt_copy(in, out, key, cword, count); |
241 | return; | 241 | return; |
242 | } | 242 | } |
@@ -248,7 +248,7 @@ static inline u8 *cbc_crypt(const u8 *in, u8 *out, u32 *key, | |||
248 | u8 *iv, struct cword *cword, int count) | 248 | u8 *iv, struct cword *cword, int count) |
249 | { | 249 | { |
250 | /* Padlock in CBC mode fetches at least cbc_fetch_bytes of data. */ | 250 | /* Padlock in CBC mode fetches at least cbc_fetch_bytes of data. */ |
251 | if (unlikely(((unsigned long)in & PAGE_SIZE) + cbc_fetch_bytes > PAGE_SIZE)) | 251 | if (unlikely(((unsigned long)in & ~PAGE_MASK) + cbc_fetch_bytes > PAGE_SIZE)) |
252 | return cbc_crypt_copy(in, out, key, iv, cword, count); | 252 | return cbc_crypt_copy(in, out, key, iv, cword, count); |
253 | 253 | ||
254 | return rep_xcrypt_cbc(in, out, key, iv, cword, count); | 254 | return rep_xcrypt_cbc(in, out, key, iv, cword, count); |
diff --git a/drivers/i2c/busses/i2c-pnx.c b/drivers/i2c/busses/i2c-pnx.c index 1fca59077949..fbab6846ae64 100644 --- a/drivers/i2c/busses/i2c-pnx.c +++ b/drivers/i2c/busses/i2c-pnx.c | |||
@@ -650,7 +650,7 @@ static int __devinit i2c_pnx_probe(struct platform_device *pdev) | |||
650 | return 0; | 650 | return 0; |
651 | 651 | ||
652 | out_irq: | 652 | out_irq: |
653 | free_irq(alg_data->irq, alg_data); | 653 | free_irq(alg_data->irq, i2c_pnx->adapter); |
654 | out_clock: | 654 | out_clock: |
655 | i2c_pnx->set_clock_stop(pdev); | 655 | i2c_pnx->set_clock_stop(pdev); |
656 | out_unmap: | 656 | out_unmap: |
@@ -669,7 +669,7 @@ static int __devexit i2c_pnx_remove(struct platform_device *pdev) | |||
669 | struct i2c_adapter *adap = i2c_pnx->adapter; | 669 | struct i2c_adapter *adap = i2c_pnx->adapter; |
670 | struct i2c_pnx_algo_data *alg_data = adap->algo_data; | 670 | struct i2c_pnx_algo_data *alg_data = adap->algo_data; |
671 | 671 | ||
672 | free_irq(alg_data->irq, alg_data); | 672 | free_irq(alg_data->irq, i2c_pnx->adapter); |
673 | i2c_del_adapter(adap); | 673 | i2c_del_adapter(adap); |
674 | i2c_pnx->set_clock_stop(pdev); | 674 | i2c_pnx->set_clock_stop(pdev); |
675 | iounmap((void *)alg_data->ioaddr); | 675 | iounmap((void *)alg_data->ioaddr); |
diff --git a/drivers/i2c/chips/tsl2550.c b/drivers/i2c/chips/tsl2550.c index aa96bd2d27ea..a0702f36a72f 100644 --- a/drivers/i2c/chips/tsl2550.c +++ b/drivers/i2c/chips/tsl2550.c | |||
@@ -257,6 +257,7 @@ static DEVICE_ATTR(operating_mode, S_IWUSR | S_IRUGO, | |||
257 | 257 | ||
258 | static ssize_t __tsl2550_show_lux(struct i2c_client *client, char *buf) | 258 | static ssize_t __tsl2550_show_lux(struct i2c_client *client, char *buf) |
259 | { | 259 | { |
260 | struct tsl2550_data *data = i2c_get_clientdata(client); | ||
260 | u8 ch0, ch1; | 261 | u8 ch0, ch1; |
261 | int ret; | 262 | int ret; |
262 | 263 | ||
@@ -274,6 +275,8 @@ static ssize_t __tsl2550_show_lux(struct i2c_client *client, char *buf) | |||
274 | ret = tsl2550_calculate_lux(ch0, ch1); | 275 | ret = tsl2550_calculate_lux(ch0, ch1); |
275 | if (ret < 0) | 276 | if (ret < 0) |
276 | return ret; | 277 | return ret; |
278 | if (data->operating_mode == 1) | ||
279 | ret *= 5; | ||
277 | 280 | ||
278 | return sprintf(buf, "%d\n", ret); | 281 | return sprintf(buf, "%d\n", ret); |
279 | } | 282 | } |
diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c index 8d80fceca6a4..296504355142 100644 --- a/drivers/i2c/i2c-core.c +++ b/drivers/i2c/i2c-core.c | |||
@@ -762,6 +762,7 @@ int i2c_del_adapter(struct i2c_adapter *adap) | |||
762 | { | 762 | { |
763 | int res = 0; | 763 | int res = 0; |
764 | struct i2c_adapter *found; | 764 | struct i2c_adapter *found; |
765 | struct i2c_client *client, *next; | ||
765 | 766 | ||
766 | /* First make sure that this adapter was ever added */ | 767 | /* First make sure that this adapter was ever added */ |
767 | mutex_lock(&core_lock); | 768 | mutex_lock(&core_lock); |
@@ -781,6 +782,16 @@ int i2c_del_adapter(struct i2c_adapter *adap) | |||
781 | if (res) | 782 | if (res) |
782 | return res; | 783 | return res; |
783 | 784 | ||
785 | /* Remove devices instantiated from sysfs */ | ||
786 | list_for_each_entry_safe(client, next, &userspace_devices, detected) { | ||
787 | if (client->adapter == adap) { | ||
788 | dev_dbg(&adap->dev, "Removing %s at 0x%x\n", | ||
789 | client->name, client->addr); | ||
790 | list_del(&client->detected); | ||
791 | i2c_unregister_device(client); | ||
792 | } | ||
793 | } | ||
794 | |||
784 | /* Detach any active clients. This can't fail, thus we do not | 795 | /* Detach any active clients. This can't fail, thus we do not |
785 | checking the returned value. */ | 796 | checking the returned value. */ |
786 | res = device_for_each_child(&adap->dev, NULL, __unregister_client); | 797 | res = device_for_each_child(&adap->dev, NULL, __unregister_client); |
diff --git a/drivers/misc/eeprom/at24.c b/drivers/misc/eeprom/at24.c index db39f4a52f53..2cb2736d65aa 100644 --- a/drivers/misc/eeprom/at24.c +++ b/drivers/misc/eeprom/at24.c | |||
@@ -158,6 +158,7 @@ static ssize_t at24_eeprom_read(struct at24_data *at24, char *buf, | |||
158 | struct i2c_msg msg[2]; | 158 | struct i2c_msg msg[2]; |
159 | u8 msgbuf[2]; | 159 | u8 msgbuf[2]; |
160 | struct i2c_client *client; | 160 | struct i2c_client *client; |
161 | unsigned long timeout, read_time; | ||
161 | int status, i; | 162 | int status, i; |
162 | 163 | ||
163 | memset(msg, 0, sizeof(msg)); | 164 | memset(msg, 0, sizeof(msg)); |
@@ -183,47 +184,60 @@ static ssize_t at24_eeprom_read(struct at24_data *at24, char *buf, | |||
183 | if (count > io_limit) | 184 | if (count > io_limit) |
184 | count = io_limit; | 185 | count = io_limit; |
185 | 186 | ||
186 | /* Smaller eeproms can work given some SMBus extension calls */ | ||
187 | if (at24->use_smbus) { | 187 | if (at24->use_smbus) { |
188 | /* Smaller eeproms can work given some SMBus extension calls */ | ||
188 | if (count > I2C_SMBUS_BLOCK_MAX) | 189 | if (count > I2C_SMBUS_BLOCK_MAX) |
189 | count = I2C_SMBUS_BLOCK_MAX; | 190 | count = I2C_SMBUS_BLOCK_MAX; |
190 | status = i2c_smbus_read_i2c_block_data(client, offset, | 191 | } else { |
191 | count, buf); | 192 | /* |
192 | dev_dbg(&client->dev, "smbus read %zu@%d --> %d\n", | 193 | * When we have a better choice than SMBus calls, use a |
193 | count, offset, status); | 194 | * combined I2C message. Write address; then read up to |
194 | return (status < 0) ? -EIO : status; | 195 | * io_limit data bytes. Note that read page rollover helps us |
196 | * here (unlike writes). msgbuf is u8 and will cast to our | ||
197 | * needs. | ||
198 | */ | ||
199 | i = 0; | ||
200 | if (at24->chip.flags & AT24_FLAG_ADDR16) | ||
201 | msgbuf[i++] = offset >> 8; | ||
202 | msgbuf[i++] = offset; | ||
203 | |||
204 | msg[0].addr = client->addr; | ||
205 | msg[0].buf = msgbuf; | ||
206 | msg[0].len = i; | ||
207 | |||
208 | msg[1].addr = client->addr; | ||
209 | msg[1].flags = I2C_M_RD; | ||
210 | msg[1].buf = buf; | ||
211 | msg[1].len = count; | ||
195 | } | 212 | } |
196 | 213 | ||
197 | /* | 214 | /* |
198 | * When we have a better choice than SMBus calls, use a combined | 215 | * Reads fail if the previous write didn't complete yet. We may |
199 | * I2C message. Write address; then read up to io_limit data bytes. | 216 | * loop a few times until this one succeeds, waiting at least |
200 | * Note that read page rollover helps us here (unlike writes). | 217 | * long enough for one entire page write to work. |
201 | * msgbuf is u8 and will cast to our needs. | ||
202 | */ | 218 | */ |
203 | i = 0; | 219 | timeout = jiffies + msecs_to_jiffies(write_timeout); |
204 | if (at24->chip.flags & AT24_FLAG_ADDR16) | 220 | do { |
205 | msgbuf[i++] = offset >> 8; | 221 | read_time = jiffies; |
206 | msgbuf[i++] = offset; | 222 | if (at24->use_smbus) { |
207 | 223 | status = i2c_smbus_read_i2c_block_data(client, offset, | |
208 | msg[0].addr = client->addr; | 224 | count, buf); |
209 | msg[0].buf = msgbuf; | 225 | } else { |
210 | msg[0].len = i; | 226 | status = i2c_transfer(client->adapter, msg, 2); |
227 | if (status == 2) | ||
228 | status = count; | ||
229 | } | ||
230 | dev_dbg(&client->dev, "read %zu@%d --> %d (%ld)\n", | ||
231 | count, offset, status, jiffies); | ||
211 | 232 | ||
212 | msg[1].addr = client->addr; | 233 | if (status == count) |
213 | msg[1].flags = I2C_M_RD; | 234 | return count; |
214 | msg[1].buf = buf; | ||
215 | msg[1].len = count; | ||
216 | 235 | ||
217 | status = i2c_transfer(client->adapter, msg, 2); | 236 | /* REVISIT: at HZ=100, this is sloooow */ |
218 | dev_dbg(&client->dev, "i2c read %zu@%d --> %d\n", | 237 | msleep(1); |
219 | count, offset, status); | 238 | } while (time_before(read_time, timeout)); |
220 | 239 | ||
221 | if (status == 2) | 240 | return -ETIMEDOUT; |
222 | return count; | ||
223 | else if (status >= 0) | ||
224 | return -EIO; | ||
225 | else | ||
226 | return status; | ||
227 | } | 241 | } |
228 | 242 | ||
229 | static ssize_t at24_read(struct at24_data *at24, | 243 | static ssize_t at24_read(struct at24_data *at24, |
diff --git a/drivers/net/wireless/iwlwifi/iwl-tx.c b/drivers/net/wireless/iwlwifi/iwl-tx.c index fb9bcfa6d947..b7e196e3c8d3 100644 --- a/drivers/net/wireless/iwlwifi/iwl-tx.c +++ b/drivers/net/wireless/iwlwifi/iwl-tx.c | |||
@@ -1277,8 +1277,16 @@ int iwl_tx_agg_stop(struct iwl_priv *priv , const u8 *ra, u16 tid) | |||
1277 | return -ENXIO; | 1277 | return -ENXIO; |
1278 | } | 1278 | } |
1279 | 1279 | ||
1280 | if (priv->stations[sta_id].tid[tid].agg.state == | ||
1281 | IWL_EMPTYING_HW_QUEUE_ADDBA) { | ||
1282 | IWL_DEBUG_HT(priv, "AGG stop before setup done\n"); | ||
1283 | ieee80211_stop_tx_ba_cb_irqsafe(priv->hw, ra, tid); | ||
1284 | priv->stations[sta_id].tid[tid].agg.state = IWL_AGG_OFF; | ||
1285 | return 0; | ||
1286 | } | ||
1287 | |||
1280 | if (priv->stations[sta_id].tid[tid].agg.state != IWL_AGG_ON) | 1288 | if (priv->stations[sta_id].tid[tid].agg.state != IWL_AGG_ON) |
1281 | IWL_WARN(priv, "Stopping AGG while state not IWL_AGG_ON\n"); | 1289 | IWL_WARN(priv, "Stopping AGG while state not ON or starting\n"); |
1282 | 1290 | ||
1283 | tid_data = &priv->stations[sta_id].tid[tid]; | 1291 | tid_data = &priv->stations[sta_id].tid[tid]; |
1284 | ssn = (tid_data->seq_number & IEEE80211_SCTL_SEQ) >> 4; | 1292 | ssn = (tid_data->seq_number & IEEE80211_SCTL_SEQ) >> 4; |
diff --git a/drivers/scsi/hosts.c b/drivers/scsi/hosts.c index 5fd2da494d08..c968cc31cd86 100644 --- a/drivers/scsi/hosts.c +++ b/drivers/scsi/hosts.c | |||
@@ -164,8 +164,8 @@ void scsi_remove_host(struct Scsi_Host *shost) | |||
164 | return; | 164 | return; |
165 | } | 165 | } |
166 | spin_unlock_irqrestore(shost->host_lock, flags); | 166 | spin_unlock_irqrestore(shost->host_lock, flags); |
167 | mutex_unlock(&shost->scan_mutex); | ||
168 | scsi_forget_host(shost); | 167 | scsi_forget_host(shost); |
168 | mutex_unlock(&shost->scan_mutex); | ||
169 | scsi_proc_host_rm(shost); | 169 | scsi_proc_host_rm(shost); |
170 | 170 | ||
171 | spin_lock_irqsave(shost->host_lock, flags); | 171 | spin_lock_irqsave(shost->host_lock, flags); |
diff --git a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c index 0547a7f44d42..47291bcff0d5 100644 --- a/drivers/scsi/scsi_scan.c +++ b/drivers/scsi/scsi_scan.c | |||
@@ -952,16 +952,6 @@ static int scsi_add_lun(struct scsi_device *sdev, unsigned char *inq_result, | |||
952 | return SCSI_SCAN_LUN_PRESENT; | 952 | return SCSI_SCAN_LUN_PRESENT; |
953 | } | 953 | } |
954 | 954 | ||
955 | static inline void scsi_destroy_sdev(struct scsi_device *sdev) | ||
956 | { | ||
957 | scsi_device_set_state(sdev, SDEV_DEL); | ||
958 | if (sdev->host->hostt->slave_destroy) | ||
959 | sdev->host->hostt->slave_destroy(sdev); | ||
960 | transport_destroy_device(&sdev->sdev_gendev); | ||
961 | put_device(&sdev->sdev_dev); | ||
962 | put_device(&sdev->sdev_gendev); | ||
963 | } | ||
964 | |||
965 | #ifdef CONFIG_SCSI_LOGGING | 955 | #ifdef CONFIG_SCSI_LOGGING |
966 | /** | 956 | /** |
967 | * scsi_inq_str - print INQUIRY data from min to max index, strip trailing whitespace | 957 | * scsi_inq_str - print INQUIRY data from min to max index, strip trailing whitespace |
@@ -1139,7 +1129,7 @@ static int scsi_probe_and_add_lun(struct scsi_target *starget, | |||
1139 | } | 1129 | } |
1140 | } | 1130 | } |
1141 | } else | 1131 | } else |
1142 | scsi_destroy_sdev(sdev); | 1132 | __scsi_remove_device(sdev); |
1143 | out: | 1133 | out: |
1144 | return res; | 1134 | return res; |
1145 | } | 1135 | } |
@@ -1500,7 +1490,7 @@ static int scsi_report_lun_scan(struct scsi_target *starget, int bflags, | |||
1500 | /* | 1490 | /* |
1501 | * the sdev we used didn't appear in the report luns scan | 1491 | * the sdev we used didn't appear in the report luns scan |
1502 | */ | 1492 | */ |
1503 | scsi_destroy_sdev(sdev); | 1493 | __scsi_remove_device(sdev); |
1504 | return ret; | 1494 | return ret; |
1505 | } | 1495 | } |
1506 | 1496 | ||
@@ -1710,7 +1700,7 @@ static void scsi_sysfs_add_devices(struct Scsi_Host *shost) | |||
1710 | shost_for_each_device(sdev, shost) { | 1700 | shost_for_each_device(sdev, shost) { |
1711 | if (!scsi_host_scan_allowed(shost) || | 1701 | if (!scsi_host_scan_allowed(shost) || |
1712 | scsi_sysfs_add_sdev(sdev) != 0) | 1702 | scsi_sysfs_add_sdev(sdev) != 0) |
1713 | scsi_destroy_sdev(sdev); | 1703 | __scsi_remove_device(sdev); |
1714 | } | 1704 | } |
1715 | } | 1705 | } |
1716 | 1706 | ||
@@ -1943,7 +1933,7 @@ void scsi_free_host_dev(struct scsi_device *sdev) | |||
1943 | { | 1933 | { |
1944 | BUG_ON(sdev->id != sdev->host->this_id); | 1934 | BUG_ON(sdev->id != sdev->host->this_id); |
1945 | 1935 | ||
1946 | scsi_destroy_sdev(sdev); | 1936 | __scsi_remove_device(sdev); |
1947 | } | 1937 | } |
1948 | EXPORT_SYMBOL(scsi_free_host_dev); | 1938 | EXPORT_SYMBOL(scsi_free_host_dev); |
1949 | 1939 | ||
diff --git a/drivers/scsi/scsi_sysfs.c b/drivers/scsi/scsi_sysfs.c index 5c7eb63a19d1..392d8db33905 100644 --- a/drivers/scsi/scsi_sysfs.c +++ b/drivers/scsi/scsi_sysfs.c | |||
@@ -854,82 +854,73 @@ int scsi_sysfs_add_sdev(struct scsi_device *sdev) | |||
854 | transport_configure_device(&starget->dev); | 854 | transport_configure_device(&starget->dev); |
855 | error = device_add(&sdev->sdev_gendev); | 855 | error = device_add(&sdev->sdev_gendev); |
856 | if (error) { | 856 | if (error) { |
857 | put_device(sdev->sdev_gendev.parent); | ||
858 | printk(KERN_INFO "error 1\n"); | 857 | printk(KERN_INFO "error 1\n"); |
859 | return error; | 858 | goto out_remove; |
860 | } | 859 | } |
861 | error = device_add(&sdev->sdev_dev); | 860 | error = device_add(&sdev->sdev_dev); |
862 | if (error) { | 861 | if (error) { |
863 | printk(KERN_INFO "error 2\n"); | 862 | printk(KERN_INFO "error 2\n"); |
864 | goto clean_device; | 863 | device_del(&sdev->sdev_gendev); |
864 | goto out_remove; | ||
865 | } | 865 | } |
866 | transport_add_device(&sdev->sdev_gendev); | ||
867 | sdev->is_visible = 1; | ||
866 | 868 | ||
867 | /* create queue files, which may be writable, depending on the host */ | 869 | /* create queue files, which may be writable, depending on the host */ |
868 | if (sdev->host->hostt->change_queue_depth) | 870 | if (sdev->host->hostt->change_queue_depth) |
869 | error = device_create_file(&sdev->sdev_gendev, &sdev_attr_queue_depth_rw); | 871 | error = device_create_file(&sdev->sdev_gendev, &sdev_attr_queue_depth_rw); |
870 | else | 872 | else |
871 | error = device_create_file(&sdev->sdev_gendev, &dev_attr_queue_depth); | 873 | error = device_create_file(&sdev->sdev_gendev, &dev_attr_queue_depth); |
872 | if (error) { | 874 | if (error) |
873 | __scsi_remove_device(sdev); | 875 | goto out_remove; |
874 | goto out; | 876 | |
875 | } | ||
876 | if (sdev->host->hostt->change_queue_type) | 877 | if (sdev->host->hostt->change_queue_type) |
877 | error = device_create_file(&sdev->sdev_gendev, &sdev_attr_queue_type_rw); | 878 | error = device_create_file(&sdev->sdev_gendev, &sdev_attr_queue_type_rw); |
878 | else | 879 | else |
879 | error = device_create_file(&sdev->sdev_gendev, &dev_attr_queue_type); | 880 | error = device_create_file(&sdev->sdev_gendev, &dev_attr_queue_type); |
880 | if (error) { | 881 | if (error) |
881 | __scsi_remove_device(sdev); | 882 | goto out_remove; |
882 | goto out; | ||
883 | } | ||
884 | 883 | ||
885 | error = bsg_register_queue(rq, &sdev->sdev_gendev, NULL, NULL); | 884 | error = bsg_register_queue(rq, &sdev->sdev_gendev, NULL, NULL); |
886 | 885 | ||
887 | if (error) | 886 | if (error) |
887 | /* we're treating error on bsg register as non-fatal, | ||
888 | * so pretend nothing went wrong */ | ||
888 | sdev_printk(KERN_INFO, sdev, | 889 | sdev_printk(KERN_INFO, sdev, |
889 | "Failed to register bsg queue, errno=%d\n", error); | 890 | "Failed to register bsg queue, errno=%d\n", error); |
890 | 891 | ||
891 | /* we're treating error on bsg register as non-fatal, so pretend | ||
892 | * nothing went wrong */ | ||
893 | error = 0; | ||
894 | |||
895 | /* add additional host specific attributes */ | 892 | /* add additional host specific attributes */ |
896 | if (sdev->host->hostt->sdev_attrs) { | 893 | if (sdev->host->hostt->sdev_attrs) { |
897 | for (i = 0; sdev->host->hostt->sdev_attrs[i]; i++) { | 894 | for (i = 0; sdev->host->hostt->sdev_attrs[i]; i++) { |
898 | error = device_create_file(&sdev->sdev_gendev, | 895 | error = device_create_file(&sdev->sdev_gendev, |
899 | sdev->host->hostt->sdev_attrs[i]); | 896 | sdev->host->hostt->sdev_attrs[i]); |
900 | if (error) { | 897 | if (error) |
901 | __scsi_remove_device(sdev); | 898 | goto out_remove; |
902 | goto out; | ||
903 | } | ||
904 | } | 899 | } |
905 | } | 900 | } |
906 | 901 | ||
907 | transport_add_device(&sdev->sdev_gendev); | 902 | return 0; |
908 | out: | ||
909 | return error; | ||
910 | |||
911 | clean_device: | ||
912 | scsi_device_set_state(sdev, SDEV_CANCEL); | ||
913 | |||
914 | device_del(&sdev->sdev_gendev); | ||
915 | transport_destroy_device(&sdev->sdev_gendev); | ||
916 | put_device(&sdev->sdev_dev); | ||
917 | put_device(&sdev->sdev_gendev); | ||
918 | 903 | ||
904 | out_remove: | ||
905 | __scsi_remove_device(sdev); | ||
919 | return error; | 906 | return error; |
907 | |||
920 | } | 908 | } |
921 | 909 | ||
922 | void __scsi_remove_device(struct scsi_device *sdev) | 910 | void __scsi_remove_device(struct scsi_device *sdev) |
923 | { | 911 | { |
924 | struct device *dev = &sdev->sdev_gendev; | 912 | struct device *dev = &sdev->sdev_gendev; |
925 | 913 | ||
926 | if (scsi_device_set_state(sdev, SDEV_CANCEL) != 0) | 914 | if (sdev->is_visible) { |
927 | return; | 915 | if (scsi_device_set_state(sdev, SDEV_CANCEL) != 0) |
916 | return; | ||
928 | 917 | ||
929 | bsg_unregister_queue(sdev->request_queue); | 918 | bsg_unregister_queue(sdev->request_queue); |
930 | device_unregister(&sdev->sdev_dev); | 919 | device_unregister(&sdev->sdev_dev); |
931 | transport_remove_device(dev); | 920 | transport_remove_device(dev); |
932 | device_del(dev); | 921 | device_del(dev); |
922 | } else | ||
923 | put_device(&sdev->sdev_dev); | ||
933 | scsi_device_set_state(sdev, SDEV_DEL); | 924 | scsi_device_set_state(sdev, SDEV_DEL); |
934 | if (sdev->host->hostt->slave_destroy) | 925 | if (sdev->host->hostt->slave_destroy) |
935 | sdev->host->hostt->slave_destroy(sdev); | 926 | sdev->host->hostt->slave_destroy(sdev); |
diff --git a/drivers/scsi/sd_dif.c b/drivers/scsi/sd_dif.c index 88da97745710..84be62149c6c 100644 --- a/drivers/scsi/sd_dif.c +++ b/drivers/scsi/sd_dif.c | |||
@@ -418,7 +418,7 @@ error: | |||
418 | __func__, virt, phys, be32_to_cpu(sdt->ref_tag), | 418 | __func__, virt, phys, be32_to_cpu(sdt->ref_tag), |
419 | be16_to_cpu(sdt->app_tag)); | 419 | be16_to_cpu(sdt->app_tag)); |
420 | 420 | ||
421 | return -EIO; | 421 | return -EILSEQ; |
422 | } | 422 | } |
423 | 423 | ||
424 | /* | 424 | /* |
diff --git a/drivers/serial/bcm63xx_uart.c b/drivers/serial/bcm63xx_uart.c index beddaa6e9069..37ad0c449937 100644 --- a/drivers/serial/bcm63xx_uart.c +++ b/drivers/serial/bcm63xx_uart.c | |||
@@ -242,7 +242,7 @@ static void bcm_uart_do_rx(struct uart_port *port) | |||
242 | * higher than fifo size anyway since we're much faster than | 242 | * higher than fifo size anyway since we're much faster than |
243 | * serial port */ | 243 | * serial port */ |
244 | max_count = 32; | 244 | max_count = 32; |
245 | tty = port->info->port.tty; | 245 | tty = port->state->port.tty; |
246 | do { | 246 | do { |
247 | unsigned int iestat, c, cstat; | 247 | unsigned int iestat, c, cstat; |
248 | char flag; | 248 | char flag; |
@@ -318,7 +318,7 @@ static void bcm_uart_do_tx(struct uart_port *port) | |||
318 | return; | 318 | return; |
319 | } | 319 | } |
320 | 320 | ||
321 | xmit = &port->info->xmit; | 321 | xmit = &port->state->xmit; |
322 | if (uart_circ_empty(xmit)) | 322 | if (uart_circ_empty(xmit)) |
323 | goto txq_empty; | 323 | goto txq_empty; |
324 | 324 | ||
diff --git a/drivers/serial/of_serial.c b/drivers/serial/of_serial.c index 02406ba6da1c..cdf172eda2e3 100644 --- a/drivers/serial/of_serial.c +++ b/drivers/serial/of_serial.c | |||
@@ -161,6 +161,7 @@ static int of_platform_serial_remove(struct of_device *ofdev) | |||
161 | static struct of_device_id __devinitdata of_platform_serial_table[] = { | 161 | static struct of_device_id __devinitdata of_platform_serial_table[] = { |
162 | { .type = "serial", .compatible = "ns8250", .data = (void *)PORT_8250, }, | 162 | { .type = "serial", .compatible = "ns8250", .data = (void *)PORT_8250, }, |
163 | { .type = "serial", .compatible = "ns16450", .data = (void *)PORT_16450, }, | 163 | { .type = "serial", .compatible = "ns16450", .data = (void *)PORT_16450, }, |
164 | { .type = "serial", .compatible = "ns16550a", .data = (void *)PORT_16550A, }, | ||
164 | { .type = "serial", .compatible = "ns16550", .data = (void *)PORT_16550, }, | 165 | { .type = "serial", .compatible = "ns16550", .data = (void *)PORT_16550, }, |
165 | { .type = "serial", .compatible = "ns16750", .data = (void *)PORT_16750, }, | 166 | { .type = "serial", .compatible = "ns16750", .data = (void *)PORT_16750, }, |
166 | { .type = "serial", .compatible = "ns16850", .data = (void *)PORT_16850, }, | 167 | { .type = "serial", .compatible = "ns16850", .data = (void *)PORT_16850, }, |
diff --git a/drivers/watchdog/pnx4008_wdt.c b/drivers/watchdog/pnx4008_wdt.c index f24d04132eda..4d227b152001 100644 --- a/drivers/watchdog/pnx4008_wdt.c +++ b/drivers/watchdog/pnx4008_wdt.c | |||
@@ -317,7 +317,7 @@ static int __devexit pnx4008_wdt_remove(struct platform_device *pdev) | |||
317 | 317 | ||
318 | static struct platform_driver platform_wdt_driver = { | 318 | static struct platform_driver platform_wdt_driver = { |
319 | .driver = { | 319 | .driver = { |
320 | .name = "watchdog", | 320 | .name = "pnx4008-watchdog", |
321 | .owner = THIS_MODULE, | 321 | .owner = THIS_MODULE, |
322 | }, | 322 | }, |
323 | .probe = pnx4008_wdt_probe, | 323 | .probe = pnx4008_wdt_probe, |
@@ -352,4 +352,4 @@ MODULE_PARM_DESC(nowayout, | |||
352 | 352 | ||
353 | MODULE_LICENSE("GPL"); | 353 | MODULE_LICENSE("GPL"); |
354 | MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR); | 354 | MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR); |
355 | MODULE_ALIAS("platform:watchdog"); | 355 | MODULE_ALIAS("platform:pnx4008-watchdog"); |