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 'spi-v3.12-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi

Pull spi fixes from Mark Brown:
"This is all driver updates, mostly fixes for error handling paths
except for the s3c64xx and hspi fixes for trying to use runtime PM
before it is enabled and the pxa2xx fix for interactions between power
management and interrupt handling"

* tag 'spi-v3.12-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi:
spi: atmel: Fix incorrect error path
spi/hspi: fixup Runtime PM enable timing
spi/s3c64xx: Ensure runtime PM is enabled prior to registration
spi/clps711x: drop clk_put for devm_clk_get in spi_clps711x_probe()
spi: fix return value check in dspi_probe()
spi: mpc512x: fix error return code in mpc512x_psc_spi_do_probe()
spi: clps711x: Don't call kfree() after spi_master_put/spi_unregister_master
spi/pxa2xx: check status register as well to determine if the device is off

+21 -18
+2 -1
drivers/spi/spi-atmel.c
··· 1583 1583 /* Initialize the hardware */ 1584 1584 ret = clk_prepare_enable(clk); 1585 1585 if (ret) 1586 - goto out_unmap_regs; 1586 + goto out_free_irq; 1587 1587 spi_writel(as, CR, SPI_BIT(SWRST)); 1588 1588 spi_writel(as, CR, SPI_BIT(SWRST)); /* AT91SAM9263 Rev B workaround */ 1589 1589 if (as->caps.has_wdrbt) { ··· 1614 1614 spi_writel(as, CR, SPI_BIT(SWRST)); 1615 1615 spi_writel(as, CR, SPI_BIT(SWRST)); /* AT91SAM9263 Rev B workaround */ 1616 1616 clk_disable_unprepare(clk); 1617 + out_free_irq: 1617 1618 free_irq(irq, master); 1618 1619 out_unmap_regs: 1619 1620 iounmap(as->regs);
-3
drivers/spi/spi-clps711x.c
··· 226 226 dev_name(&pdev->dev), hw); 227 227 if (ret) { 228 228 dev_err(&pdev->dev, "Can't request IRQ\n"); 229 - clk_put(hw->spi_clk); 230 229 goto clk_out; 231 230 } 232 231 ··· 246 247 gpio_free(hw->chipselect[i]); 247 248 248 249 spi_master_put(master); 249 - kfree(master); 250 250 251 251 return ret; 252 252 } ··· 261 263 gpio_free(hw->chipselect[i]); 262 264 263 265 spi_unregister_master(master); 264 - kfree(master); 265 266 266 267 return 0; 267 268 }
+2 -8
drivers/spi/spi-fsl-dspi.c
··· 476 476 master->bus_num = bus_num; 477 477 478 478 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 479 - if (!res) { 480 - dev_err(&pdev->dev, "can't get platform resource\n"); 481 - ret = -EINVAL; 482 - goto out_master_put; 483 - } 484 - 485 479 dspi->base = devm_ioremap_resource(&pdev->dev, res); 486 - if (!dspi->base) { 487 - ret = -EINVAL; 480 + if (IS_ERR(dspi->base)) { 481 + ret = PTR_ERR(dspi->base); 488 482 goto out_master_put; 489 483 } 490 484
+3 -1
drivers/spi/spi-mpc512x-psc.c
··· 522 522 psc_num = master->bus_num; 523 523 snprintf(clk_name, sizeof(clk_name), "psc%d_mclk", psc_num); 524 524 clk = devm_clk_get(dev, clk_name); 525 - if (IS_ERR(clk)) 525 + if (IS_ERR(clk)) { 526 + ret = PTR_ERR(clk); 526 527 goto free_irq; 528 + } 527 529 ret = clk_prepare_enable(clk); 528 530 if (ret) 529 531 goto free_irq;
+10 -1
drivers/spi/spi-pxa2xx.c
··· 546 546 if (pm_runtime_suspended(&drv_data->pdev->dev)) 547 547 return IRQ_NONE; 548 548 549 - sccr1_reg = read_SSCR1(reg); 549 + /* 550 + * If the device is not yet in RPM suspended state and we get an 551 + * interrupt that is meant for another device, check if status bits 552 + * are all set to one. That means that the device is already 553 + * powered off. 554 + */ 550 555 status = read_SSSR(reg); 556 + if (status == ~0) 557 + return IRQ_NONE; 558 + 559 + sccr1_reg = read_SSCR1(reg); 551 560 552 561 /* Ignore possible writes if we don't need to write */ 553 562 if (!(sccr1_reg & SSCR1_TIE))
+2 -2
drivers/spi/spi-s3c64xx.c
··· 1428 1428 S3C64XX_SPI_INT_TX_OVERRUN_EN | S3C64XX_SPI_INT_TX_UNDERRUN_EN, 1429 1429 sdd->regs + S3C64XX_SPI_INT_EN); 1430 1430 1431 + pm_runtime_enable(&pdev->dev); 1432 + 1431 1433 if (spi_register_master(master)) { 1432 1434 dev_err(&pdev->dev, "cannot register SPI master\n"); 1433 1435 ret = -EBUSY; ··· 1441 1439 dev_dbg(&pdev->dev, "\tIOmem=[%pR]\tDMA=[Rx-%d, Tx-%d]\n", 1442 1440 mem_res, 1443 1441 sdd->rx_dma.dmach, sdd->tx_dma.dmach); 1444 - 1445 - pm_runtime_enable(&pdev->dev); 1446 1442 1447 1443 return 0; 1448 1444
+2 -2
drivers/spi/spi-sh-hspi.c
··· 296 296 goto error1; 297 297 } 298 298 299 + pm_runtime_enable(&pdev->dev); 300 + 299 301 master->num_chipselect = 1; 300 302 master->bus_num = pdev->id; 301 303 master->setup = hspi_setup; ··· 310 308 dev_err(&pdev->dev, "spi_register_master error.\n"); 311 309 goto error1; 312 310 } 313 - 314 - pm_runtime_enable(&pdev->dev); 315 311 316 312 return 0; 317 313