summaryrefslogtreecommitdiffstats
path: root/drivers/spi/spi-pic32.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/spi/spi-pic32.c')
-rw-r--r--drivers/spi/spi-pic32.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/drivers/spi/spi-pic32.c b/drivers/spi/spi-pic32.c
index 7e5c09a7d489..f2af5e653f3d 100644
--- a/drivers/spi/spi-pic32.c
+++ b/drivers/spi/spi-pic32.c
@@ -591,7 +591,7 @@ static int pic32_spi_setup(struct spi_device *spi)
* unreliable/erroneous SPI transactions.
* To avoid that we will always handle /CS by toggling GPIO.
*/
- if (!spi->cs_gpiod)
+ if (!spi_get_csgpiod(spi, 0))
return -EINVAL;
return 0;
@@ -600,7 +600,7 @@ static int pic32_spi_setup(struct spi_device *spi)
static void pic32_spi_cleanup(struct spi_device *spi)
{
/* de-activate cs-gpio, gpiolib will handle inversion */
- gpiod_direction_output(spi->cs_gpiod, 0);
+ gpiod_direction_output(spi_get_csgpiod(spi, 0), 0);
}
static int pic32_spi_dma_prep(struct pic32_spi *pic32s, struct device *dev)
@@ -710,8 +710,7 @@ static int pic32_spi_hw_probe(struct platform_device *pdev,
struct resource *mem;
int ret;
- mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- pic32s->regs = devm_ioremap_resource(&pdev->dev, mem);
+ pic32s->regs = devm_platform_get_and_ioremap_resource(pdev, 0, &mem);
if (IS_ERR(pic32s->regs))
return PTR_ERR(pic32s->regs);
@@ -844,7 +843,7 @@ err_master:
return ret;
}
-static int pic32_spi_remove(struct platform_device *pdev)
+static void pic32_spi_remove(struct platform_device *pdev)
{
struct pic32_spi *pic32s;
@@ -852,8 +851,6 @@ static int pic32_spi_remove(struct platform_device *pdev)
pic32_spi_disable(pic32s);
clk_disable_unprepare(pic32s->clk);
pic32_spi_dma_unprep(pic32s);
-
- return 0;
}
static const struct of_device_id pic32_spi_of_match[] = {
@@ -868,7 +865,7 @@ static struct platform_driver pic32_spi_driver = {
.of_match_table = of_match_ptr(pic32_spi_of_match),
},
.probe = pic32_spi_probe,
- .remove = pic32_spi_remove,
+ .remove_new = pic32_spi_remove,
};
module_platform_driver(pic32_spi_driver);