aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/misc/mic/host/mic_x100.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2016-03-17 16:47:50 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2016-03-17 16:47:50 -0400
commit8eee93e2576c303b6071368456dcd6c9a5a021c9 (patch)
tree0c65d2dc160af900e0c87ebc4b41979c0b9075cf /drivers/misc/mic/host/mic_x100.c
parent1a4ab084afaa8e5405a3e22aca21478ee3ca5d59 (diff)
parent16617535684faf9de30620de83667214297a36b8 (diff)
Merge tag 'char-misc-4.6-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc
Pull char/misc updates from Greg KH: "Here is the big char/misc driver update for 4.6-rc1. The majority of the patches here is hwtracing and some new mic drivers, but there's a lot of other driver updates as well. Full details in the shortlog. All have been in linux-next for a while with no reported issues" * tag 'char-misc-4.6-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: (238 commits) goldfish: Fix build error of missing ioremap on UM nvmem: mediatek: Fix later provider initialization nvmem: imx-ocotp: Fix return value of imx_ocotp_read nvmem: Fix dependencies for !HAS_IOMEM archs char: genrtc: replace blacklist with whitelist drivers/hwtracing: make coresight-etm-perf.c explicitly non-modular drivers: char: mem: fix IS_ERROR_VALUE usage char: xillybus: Fix internal data structure initialization pch_phub: return -ENODATA if ROM can't be mapped Drivers: hv: vmbus: Support kexec on ws2012 r2 and above Drivers: hv: vmbus: Support handling messages on multiple CPUs Drivers: hv: utils: Remove util transport handler from list if registration fails Drivers: hv: util: Pass the channel information during the init call Drivers: hv: vmbus: avoid unneeded compiler optimizations in vmbus_wait_for_unload() Drivers: hv: vmbus: remove code duplication in message handling Drivers: hv: vmbus: avoid wait_for_completion() on crash Drivers: hv: vmbus: don't loose HVMSG_TIMER_EXPIRED messages misc: at24: replace memory_accessor with nvmem_device_read eeprom: 93xx46: extend driver to plug into the NVMEM framework eeprom: at25: extend driver to plug into the NVMEM framework ...
Diffstat (limited to 'drivers/misc/mic/host/mic_x100.c')
-rw-r--r--drivers/misc/mic/host/mic_x100.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/drivers/misc/mic/host/mic_x100.c b/drivers/misc/mic/host/mic_x100.c
index 8118ac48c764..82a973c85b5d 100644
--- a/drivers/misc/mic/host/mic_x100.c
+++ b/drivers/misc/mic/host/mic_x100.c
@@ -450,26 +450,29 @@ mic_x100_load_firmware(struct mic_device *mdev, const char *buf)
450 450
451 rc = mic_x100_get_boot_addr(mdev); 451 rc = mic_x100_get_boot_addr(mdev);
452 if (rc) 452 if (rc)
453 goto error; 453 return rc;
454 /* load OS */ 454 /* load OS */
455 rc = request_firmware(&fw, mdev->cosm_dev->firmware, &mdev->pdev->dev); 455 rc = request_firmware(&fw, mdev->cosm_dev->firmware, &mdev->pdev->dev);
456 if (rc < 0) { 456 if (rc < 0) {
457 dev_err(&mdev->pdev->dev, 457 dev_err(&mdev->pdev->dev,
458 "ramdisk request_firmware failed: %d %s\n", 458 "ramdisk request_firmware failed: %d %s\n",
459 rc, mdev->cosm_dev->firmware); 459 rc, mdev->cosm_dev->firmware);
460 goto error; 460 return rc;
461 } 461 }
462 if (mdev->bootaddr > mdev->aper.len - fw->size) { 462 if (mdev->bootaddr > mdev->aper.len - fw->size) {
463 rc = -EINVAL; 463 rc = -EINVAL;
464 dev_err(&mdev->pdev->dev, "%s %d rc %d bootaddr 0x%x\n", 464 dev_err(&mdev->pdev->dev, "%s %d rc %d bootaddr 0x%x\n",
465 __func__, __LINE__, rc, mdev->bootaddr); 465 __func__, __LINE__, rc, mdev->bootaddr);
466 release_firmware(fw);
467 goto error; 466 goto error;
468 } 467 }
469 memcpy_toio(mdev->aper.va + mdev->bootaddr, fw->data, fw->size); 468 memcpy_toio(mdev->aper.va + mdev->bootaddr, fw->data, fw->size);
470 mdev->ops->write_spad(mdev, MIC_X100_FW_SIZE, fw->size); 469 mdev->ops->write_spad(mdev, MIC_X100_FW_SIZE, fw->size);
471 if (!strcmp(mdev->cosm_dev->bootmode, "flash")) 470 if (!strcmp(mdev->cosm_dev->bootmode, "flash")) {
472 goto done; 471 rc = -EINVAL;
472 dev_err(&mdev->pdev->dev, "%s %d rc %d\n",
473 __func__, __LINE__, rc);
474 goto error;
475 }
473 /* load command line */ 476 /* load command line */
474 rc = mic_x100_load_command_line(mdev, fw); 477 rc = mic_x100_load_command_line(mdev, fw);
475 if (rc) { 478 if (rc) {
@@ -481,9 +484,11 @@ mic_x100_load_firmware(struct mic_device *mdev, const char *buf)
481 /* load ramdisk */ 484 /* load ramdisk */
482 if (mdev->cosm_dev->ramdisk) 485 if (mdev->cosm_dev->ramdisk)
483 rc = mic_x100_load_ramdisk(mdev); 486 rc = mic_x100_load_ramdisk(mdev);
487
488 return rc;
489
484error: 490error:
485 dev_dbg(&mdev->pdev->dev, "%s %d rc %d\n", __func__, __LINE__, rc); 491 release_firmware(fw);
486done:
487 return rc; 492 return rc;
488} 493}
489 494