]> Git Repo - J-linux.git/commitdiff
fpga: fpga-mgr: xilinx-spi: Simplify registration
authorMoritz Fischer <[email protected]>
Sun, 15 Nov 2020 19:51:25 +0000 (11:51 -0800)
committerGreg Kroah-Hartman <[email protected]>
Tue, 1 Dec 2020 17:49:32 +0000 (18:49 +0100)
Simplify registration using new devm_fpga_mgr_register() API.

Reviewed-by: Tom Rix <[email protected]>
Signed-off-by: Moritz Fischer <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
drivers/fpga/xilinx-spi.c

index 824abbbd631e433e9d43c1778d6b8ff30c4e946d..27defa98092ddce55d56d3ce3d980cc8104d7481 100644 (file)
@@ -259,18 +259,7 @@ static int xilinx_spi_probe(struct spi_device *spi)
        if (!mgr)
                return -ENOMEM;
 
-       spi_set_drvdata(spi, mgr);
-
-       return fpga_mgr_register(mgr);
-}
-
-static int xilinx_spi_remove(struct spi_device *spi)
-{
-       struct fpga_manager *mgr = spi_get_drvdata(spi);
-
-       fpga_mgr_unregister(mgr);
-
-       return 0;
+       return devm_fpga_mgr_register(&spi->dev, mgr);
 }
 
 static const struct of_device_id xlnx_spi_of_match[] = {
@@ -285,7 +274,6 @@ static struct spi_driver xilinx_slave_spi_driver = {
                .of_match_table = of_match_ptr(xlnx_spi_of_match),
        },
        .probe = xilinx_spi_probe,
-       .remove = xilinx_spi_remove,
 };
 
 module_spi_driver(xilinx_slave_spi_driver)
This page took 0.050166 seconds and 4 git commands to generate.