spi: rb4xx: use devm for clk_prepare_enable
Remove the remove function as it no longer does anything useful. Also remove platform_set_drvdata as get becomes completely unused. Signed-off-by: Rosen Penev <rosenp@gmail.com> Message-ID: <20250826212413.15065-4-rosenp@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>pull/1354/merge
parent
f18f0ac533
commit
ff9a7857b7
|
|
@ -156,7 +156,7 @@ static int rb4xx_spi_probe(struct platform_device *pdev)
|
|||
if (!host)
|
||||
return -ENOMEM;
|
||||
|
||||
ahb_clk = devm_clk_get(&pdev->dev, "ahb");
|
||||
ahb_clk = devm_clk_get_enabled(&pdev->dev, "ahb");
|
||||
if (IS_ERR(ahb_clk))
|
||||
return PTR_ERR(ahb_clk);
|
||||
|
||||
|
|
@ -172,7 +172,6 @@ static int rb4xx_spi_probe(struct platform_device *pdev)
|
|||
rbspi = spi_controller_get_devdata(host);
|
||||
rbspi->base = spi_base;
|
||||
rbspi->clk = ahb_clk;
|
||||
platform_set_drvdata(pdev, rbspi);
|
||||
|
||||
err = devm_spi_register_controller(&pdev->dev, host);
|
||||
if (err) {
|
||||
|
|
@ -180,23 +179,12 @@ static int rb4xx_spi_probe(struct platform_device *pdev)
|
|||
return err;
|
||||
}
|
||||
|
||||
err = clk_prepare_enable(ahb_clk);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
/* Enable SPI */
|
||||
rb4xx_write(rbspi, AR71XX_SPI_REG_FS, AR71XX_SPI_FS_GPIO);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void rb4xx_spi_remove(struct platform_device *pdev)
|
||||
{
|
||||
struct rb4xx_spi *rbspi = platform_get_drvdata(pdev);
|
||||
|
||||
clk_disable_unprepare(rbspi->clk);
|
||||
}
|
||||
|
||||
static const struct of_device_id rb4xx_spi_dt_match[] = {
|
||||
{ .compatible = "mikrotik,rb4xx-spi" },
|
||||
{ },
|
||||
|
|
@ -205,7 +193,6 @@ MODULE_DEVICE_TABLE(of, rb4xx_spi_dt_match);
|
|||
|
||||
static struct platform_driver rb4xx_spi_drv = {
|
||||
.probe = rb4xx_spi_probe,
|
||||
.remove = rb4xx_spi_remove,
|
||||
.driver = {
|
||||
.name = "rb4xx-spi",
|
||||
.of_match_table = rb4xx_spi_dt_match,
|
||||
|
|
|
|||
Loading…
Reference in New Issue