Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'staging-3.13-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging

Pull staging driver fixes from Greg KH:
"Here are a number of staging, and iio, fixes for 3.13-rc5 that resolve
some reported issues"

* tag 'staging-3.13-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging:
imx-drm: imx-drm-core: improve safety of imx_drm_add_crtc()
imx-drm: imx-drm-core: make imx_drm_crtc_register() safer
imx-drm: imx-drm-core: use defined constant for number of CRTCs.
imx-drm: imx-tve: don't call sleeping functions beneath enable_lock spinlock
imx-drm: ipu-v3: fix potential CRTC device registration race
imx-drm: imx-drm-core: fix DRM cleanup paths
imx-drm: imx-drm-core: fix error cleanup path for imx_drm_add_crtc()
staging: comedi: drivers: fix return value of comedi_load_firmware()
staging: comedi: 8255_pci: fix for newer PCI-DIO48H
iio:adc:ad7887 Fix channel reported endianness from cpu to big endian
iio:imu:adis16400 fix pressure channel scan type
staging:iio:mag:hmc5843 fix incorrect endianness of channel as a result of missuse of the IIO_ST macro.
iio: cm36651: Changed return value of read function

+85 -44
+14 -2
drivers/iio/adc/ad7887.c
··· 200 200 .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE), 201 201 .address = 1, 202 202 .scan_index = 1, 203 - .scan_type = IIO_ST('u', 12, 16, 0), 203 + .scan_type = { 204 + .sign = 'u', 205 + .realbits = 12, 206 + .storagebits = 16, 207 + .shift = 0, 208 + .endianness = IIO_BE, 209 + }, 204 210 }, 205 211 .channel[1] = { 206 212 .type = IIO_VOLTAGE, ··· 216 210 .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE), 217 211 .address = 0, 218 212 .scan_index = 0, 219 - .scan_type = IIO_ST('u', 12, 16, 0), 213 + .scan_type = { 214 + .sign = 'u', 215 + .realbits = 12, 216 + .storagebits = 16, 217 + .shift = 0, 218 + .endianness = IIO_BE, 219 + }, 220 220 }, 221 221 .channel[2] = IIO_CHAN_SOFT_TIMESTAMP(2), 222 222 .int_vref_mv = 2500,
+6 -1
drivers/iio/imu/adis16400_core.c
··· 651 651 .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE), 652 652 .address = ADIS16448_BARO_OUT, 653 653 .scan_index = ADIS16400_SCAN_BARO, 654 - .scan_type = IIO_ST('s', 16, 16, 0), 654 + .scan_type = { 655 + .sign = 's', 656 + .realbits = 16, 657 + .storagebits = 16, 658 + .endianness = IIO_BE, 659 + }, 655 660 }, 656 661 ADIS16400_TEMP_CHAN(ADIS16448_TEMP_OUT, 12), 657 662 IIO_CHAN_SOFT_TIMESTAMP(11)
+1 -1
drivers/iio/light/cm36651.c
··· 387 387 return -EINVAL; 388 388 } 389 389 390 - return IIO_VAL_INT_PLUS_MICRO; 390 + return IIO_VAL_INT; 391 391 } 392 392 393 393 static int cm36651_write_int_time(struct cm36651_data *cm36651,
+1 -1
drivers/staging/comedi/drivers.c
··· 446 446 release_firmware(fw); 447 447 } 448 448 449 - return ret; 449 + return ret < 0 ? ret : 0; 450 450 } 451 451 EXPORT_SYMBOL_GPL(comedi_load_firmware); 452 452
+12 -3
drivers/staging/comedi/drivers/8255_pci.c
··· 63 63 BOARD_ADLINK_PCI7296, 64 64 BOARD_CB_PCIDIO24, 65 65 BOARD_CB_PCIDIO24H, 66 - BOARD_CB_PCIDIO48H, 66 + BOARD_CB_PCIDIO48H_OLD, 67 + BOARD_CB_PCIDIO48H_NEW, 67 68 BOARD_CB_PCIDIO96H, 68 69 BOARD_NI_PCIDIO96, 69 70 BOARD_NI_PCIDIO96B, ··· 107 106 .dio_badr = 2, 108 107 .n_8255 = 1, 109 108 }, 110 - [BOARD_CB_PCIDIO48H] = { 109 + [BOARD_CB_PCIDIO48H_OLD] = { 111 110 .name = "cb_pci-dio48h", 112 111 .dio_badr = 1, 112 + .n_8255 = 2, 113 + }, 114 + [BOARD_CB_PCIDIO48H_NEW] = { 115 + .name = "cb_pci-dio48h", 116 + .dio_badr = 2, 113 117 .n_8255 = 2, 114 118 }, 115 119 [BOARD_CB_PCIDIO96H] = { ··· 269 263 { PCI_VDEVICE(ADLINK, 0x7296), BOARD_ADLINK_PCI7296 }, 270 264 { PCI_VDEVICE(CB, 0x0028), BOARD_CB_PCIDIO24 }, 271 265 { PCI_VDEVICE(CB, 0x0014), BOARD_CB_PCIDIO24H }, 272 - { PCI_VDEVICE(CB, 0x000b), BOARD_CB_PCIDIO48H }, 266 + { PCI_DEVICE_SUB(PCI_VENDOR_ID_CB, 0x000b, 0x0000, 0x0000), 267 + .driver_data = BOARD_CB_PCIDIO48H_OLD }, 268 + { PCI_DEVICE_SUB(PCI_VENDOR_ID_CB, 0x000b, PCI_VENDOR_ID_CB, 0x000b), 269 + .driver_data = BOARD_CB_PCIDIO48H_NEW }, 273 270 { PCI_VDEVICE(CB, 0x0017), BOARD_CB_PCIDIO96H }, 274 271 { PCI_VDEVICE(NI, 0x0160), BOARD_NI_PCIDIO96 }, 275 272 { PCI_VDEVICE(NI, 0x1630), BOARD_NI_PCIDIO96B },
+6 -1
drivers/staging/iio/magnetometer/hmc5843.c
··· 451 451 .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE) | \ 452 452 BIT(IIO_CHAN_INFO_SAMP_FREQ), \ 453 453 .scan_index = idx, \ 454 - .scan_type = IIO_ST('s', 16, 16, IIO_BE), \ 454 + .scan_type = { \ 455 + .sign = 's', \ 456 + .realbits = 16, \ 457 + .storagebits = 16, \ 458 + .endianness = IIO_BE, \ 459 + }, \ 455 460 } 456 461 457 462 static const struct iio_chan_spec hmc5843_channels[] = {
+29 -10
drivers/staging/imx-drm/imx-drm-core.c
··· 88 88 89 89 imx_drm_device_put(); 90 90 91 - drm_mode_config_cleanup(imxdrm->drm); 91 + drm_vblank_cleanup(imxdrm->drm); 92 92 drm_kms_helper_poll_fini(imxdrm->drm); 93 + drm_mode_config_cleanup(imxdrm->drm); 93 94 94 95 return 0; 95 96 } ··· 200 199 if (!file->is_master) 201 200 return; 202 201 203 - for (i = 0; i < 4; i++) 204 - imx_drm_disable_vblank(drm , i); 202 + for (i = 0; i < MAX_CRTC; i++) 203 + imx_drm_disable_vblank(drm, i); 205 204 } 206 205 207 206 static const struct file_operations imx_drm_driver_fops = { ··· 377 376 struct imx_drm_device *imxdrm = __imx_drm_device(); 378 377 int ret; 379 378 380 - drm_crtc_init(imxdrm->drm, imx_drm_crtc->crtc, 381 - imx_drm_crtc->imx_drm_helper_funcs.crtc_funcs); 382 379 ret = drm_mode_crtc_set_gamma_size(imx_drm_crtc->crtc, 256); 383 380 if (ret) 384 381 return ret; 385 382 386 383 drm_crtc_helper_add(imx_drm_crtc->crtc, 387 384 imx_drm_crtc->imx_drm_helper_funcs.crtc_helper_funcs); 385 + 386 + drm_crtc_init(imxdrm->drm, imx_drm_crtc->crtc, 387 + imx_drm_crtc->imx_drm_helper_funcs.crtc_funcs); 388 388 389 389 drm_mode_group_reinit(imxdrm->drm); 390 390 ··· 430 428 ret = drm_mode_group_init_legacy_group(imxdrm->drm, 431 429 &imxdrm->drm->primary->mode_group); 432 430 if (ret) 433 - goto err_init; 431 + goto err_kms; 434 432 435 433 ret = drm_vblank_init(imxdrm->drm, MAX_CRTC); 436 434 if (ret) 437 - goto err_init; 435 + goto err_kms; 438 436 439 437 /* 440 438 * with vblank_disable_allowed = true, vblank interrupt will be disabled ··· 443 441 */ 444 442 imxdrm->drm->vblank_disable_allowed = true; 445 443 446 - if (!imx_drm_device_get()) 444 + if (!imx_drm_device_get()) { 447 445 ret = -EINVAL; 446 + goto err_vblank; 447 + } 448 448 449 - ret = 0; 449 + mutex_unlock(&imxdrm->mutex); 450 + return 0; 450 451 451 - err_init: 452 + err_vblank: 453 + drm_vblank_cleanup(drm); 454 + err_kms: 455 + drm_kms_helper_poll_fini(drm); 456 + drm_mode_config_cleanup(drm); 452 457 mutex_unlock(&imxdrm->mutex); 453 458 454 459 return ret; ··· 501 492 502 493 mutex_lock(&imxdrm->mutex); 503 494 495 + /* 496 + * The vblank arrays are dimensioned by MAX_CRTC - we can't 497 + * pass IDs greater than this to those functions. 498 + */ 499 + if (imxdrm->pipes >= MAX_CRTC) { 500 + ret = -EINVAL; 501 + goto err_busy; 502 + } 503 + 504 504 if (imxdrm->drm->open_count) { 505 505 ret = -EBUSY; 506 506 goto err_busy; ··· 546 528 return 0; 547 529 548 530 err_register: 531 + list_del(&imx_drm_crtc->list); 549 532 kfree(imx_drm_crtc); 550 533 err_alloc: 551 534 err_busy:
-9
drivers/staging/imx-drm/imx-tve.c
··· 114 114 struct drm_encoder encoder; 115 115 struct imx_drm_encoder *imx_drm_encoder; 116 116 struct device *dev; 117 - spinlock_t enable_lock; /* serializes tve_enable/disable */ 118 117 spinlock_t lock; /* register lock */ 119 118 bool enabled; 120 119 int mode; ··· 145 146 146 147 static void tve_enable(struct imx_tve *tve) 147 148 { 148 - unsigned long flags; 149 149 int ret; 150 150 151 - spin_lock_irqsave(&tve->enable_lock, flags); 152 151 if (!tve->enabled) { 153 152 tve->enabled = true; 154 153 clk_prepare_enable(tve->clk); ··· 166 169 TVE_CD_SM_IEN | 167 170 TVE_CD_LM_IEN | 168 171 TVE_CD_MON_END_IEN); 169 - 170 - spin_unlock_irqrestore(&tve->enable_lock, flags); 171 172 } 172 173 173 174 static void tve_disable(struct imx_tve *tve) 174 175 { 175 - unsigned long flags; 176 176 int ret; 177 177 178 - spin_lock_irqsave(&tve->enable_lock, flags); 179 178 if (tve->enabled) { 180 179 tve->enabled = false; 181 180 ret = regmap_update_bits(tve->regmap, TVE_COM_CONF_REG, 182 181 TVE_IPU_CLK_EN | TVE_EN, 0); 183 182 clk_disable_unprepare(tve->clk); 184 183 } 185 - spin_unlock_irqrestore(&tve->enable_lock, flags); 186 184 } 187 185 188 186 static int tve_setup_tvout(struct imx_tve *tve) ··· 593 601 594 602 tve->dev = &pdev->dev; 595 603 spin_lock_init(&tve->lock); 596 - spin_lock_init(&tve->enable_lock); 597 604 598 605 ddc_node = of_parse_phandle(np, "ddc", 0); 599 606 if (ddc_node) {
+16 -16
drivers/staging/imx-drm/ipu-v3/ipu-common.c
··· 996 996 }, 997 997 }; 998 998 999 + static DEFINE_MUTEX(ipu_client_id_mutex); 999 1000 static int ipu_client_id; 1000 - 1001 - static int ipu_add_subdevice_pdata(struct device *dev, 1002 - const struct ipu_platform_reg *reg) 1003 - { 1004 - struct platform_device *pdev; 1005 - 1006 - pdev = platform_device_register_data(dev, reg->name, ipu_client_id++, 1007 - &reg->pdata, sizeof(struct ipu_platform_reg)); 1008 - 1009 - return PTR_ERR_OR_ZERO(pdev); 1010 - } 1011 1001 1012 1002 static int ipu_add_client_devices(struct ipu_soc *ipu) 1013 1003 { 1014 - int ret; 1015 - int i; 1004 + struct device *dev = ipu->dev; 1005 + unsigned i; 1006 + int id, ret; 1007 + 1008 + mutex_lock(&ipu_client_id_mutex); 1009 + id = ipu_client_id; 1010 + ipu_client_id += ARRAY_SIZE(client_reg); 1011 + mutex_unlock(&ipu_client_id_mutex); 1016 1012 1017 1013 for (i = 0; i < ARRAY_SIZE(client_reg); i++) { 1018 1014 const struct ipu_platform_reg *reg = &client_reg[i]; 1019 - ret = ipu_add_subdevice_pdata(ipu->dev, reg); 1020 - if (ret) 1015 + struct platform_device *pdev; 1016 + 1017 + pdev = platform_device_register_data(dev, reg->name, 1018 + id++, &reg->pdata, sizeof(reg->pdata)); 1019 + 1020 + if (IS_ERR(pdev)) 1021 1021 goto err_register; 1022 1022 } 1023 1023 1024 1024 return 0; 1025 1025 1026 1026 err_register: 1027 - platform_device_unregister_children(to_platform_device(ipu->dev)); 1027 + platform_device_unregister_children(to_platform_device(dev)); 1028 1028 1029 1029 return ret; 1030 1030 }