spi: pxa2xx: use devm_spi_register_master()
authorJingoo Han <jg1.han@samsung.com>
Tue, 24 Sep 2013 04:46:55 +0000 (13:46 +0900)
committerMark Brown <broonie@linaro.org>
Thu, 26 Sep 2013 10:42:52 +0000 (11:42 +0100)
Use devm_spi_register_master() to make cleanup paths simpler.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
drivers/spi/spi-pxa2xx.c

index 2eb06ee0b3264020d040c2b1ea8bd6745656c372..669306aa6c29623b571b92a27624f01e691f80ac 100644 (file)
@@ -1196,7 +1196,7 @@ static int pxa2xx_spi_probe(struct platform_device *pdev)
 
        /* Register with the SPI framework */
        platform_set_drvdata(pdev, drv_data);
-       status = spi_register_master(master);
+       status = devm_spi_register_master(&pdev->dev, master);
        if (status != 0) {
                dev_err(&pdev->dev, "problem registering spi master\n");
                goto out_error_clock_enabled;
@@ -1248,9 +1248,6 @@ static int pxa2xx_spi_remove(struct platform_device *pdev)
        /* Release SSP */
        pxa_ssp_free(ssp);
 
-       /* Disconnect from the SPI framework */
-       spi_unregister_master(drv_data->master);
-
        return 0;
 }