@@ -350,11 +350,6 @@ static int spi_gpio_probe_pdata(struct p
return 0;
}
-static void spi_gpio_put(void *data)
-{
- spi_master_put(data);
-}
-
static int spi_gpio_probe(struct platform_device *pdev)
{
int status;
@@ -366,16 +361,10 @@ static int spi_gpio_probe(struct platfor
of_id = of_match_device(spi_gpio_dt_ids, &pdev->dev);
- master = spi_alloc_master(dev, sizeof(*spi_gpio));
+ master = devm_spi_alloc_master(dev, sizeof(*spi_gpio));
if (!master)
return -ENOMEM;
- status = devm_add_action_or_reset(&pdev->dev, spi_gpio_put, master);
- if (status) {
- spi_master_put(master);
- return status;
- }
-
if (of_id)
status = spi_gpio_probe_dt(pdev, master);
else
@@ -435,7 +424,7 @@ static int spi_gpio_probe(struct platfor
if (status)
return status;
- return devm_spi_register_master(&pdev->dev, spi_master_get(master));
+ return devm_spi_register_master(&pdev->dev, master);
}
MODULE_ALIAS("platform:" DRIVER_NAME);