| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Freescale SPI controller driver cpm functions. |
|---|
| 3 | 4 | * |
|---|
| .. | .. |
|---|
| 9 | 10 | * CPM SPI and QE buffer descriptors mode support: |
|---|
| 10 | 11 | * Copyright (c) 2009 MontaVista Software, Inc. |
|---|
| 11 | 12 | * Author: Anton Vorontsov <avorontsov@ru.mvista.com> |
|---|
| 12 | | - * |
|---|
| 13 | | - * This program is free software; you can redistribute it and/or modify it |
|---|
| 14 | | - * under the terms of the GNU General Public License as published by the |
|---|
| 15 | | - * Free Software Foundation; either version 2 of the License, or (at your |
|---|
| 16 | | - * option) any later version. |
|---|
| 17 | 13 | */ |
|---|
| 18 | 14 | #include <asm/cpm.h> |
|---|
| 19 | 15 | #include <soc/fsl/qe/qe.h> |
|---|
| .. | .. |
|---|
| 230 | 226 | case 1: |
|---|
| 231 | 227 | kfree(fsl_dummy_rx); |
|---|
| 232 | 228 | fsl_dummy_rx = NULL; |
|---|
| 233 | | - /* fall through */ |
|---|
| 229 | + fallthrough; |
|---|
| 234 | 230 | default: |
|---|
| 235 | 231 | fsl_dummy_rx_refcnt--; |
|---|
| 236 | 232 | break; |
|---|
| .. | .. |
|---|
| 298 | 294 | switch (mspi->subblock) { |
|---|
| 299 | 295 | default: |
|---|
| 300 | 296 | dev_warn(dev, "cell-index unspecified, assuming SPI1\n"); |
|---|
| 301 | | - /* fall through */ |
|---|
| 297 | + fallthrough; |
|---|
| 302 | 298 | case 0: |
|---|
| 303 | 299 | mspi->subblock = QE_CR_SUBBLOCK_SPI1; |
|---|
| 304 | 300 | break; |
|---|
| .. | .. |
|---|
| 309 | 305 | } |
|---|
| 310 | 306 | |
|---|
| 311 | 307 | if (mspi->flags & SPI_CPM1) { |
|---|
| 312 | | - struct resource *res; |
|---|
| 313 | 308 | void *pram; |
|---|
| 314 | 309 | |
|---|
| 315 | | - res = platform_get_resource(to_platform_device(dev), |
|---|
| 316 | | - IORESOURCE_MEM, 1); |
|---|
| 317 | | - pram = devm_ioremap_resource(dev, res); |
|---|
| 310 | + pram = devm_platform_ioremap_resource(to_platform_device(dev), |
|---|
| 311 | + 1); |
|---|
| 318 | 312 | if (IS_ERR(pram)) |
|---|
| 319 | 313 | mspi->pram = NULL; |
|---|
| 320 | 314 | else |
|---|
| .. | .. |
|---|
| 398 | 392 | dma_unmap_single(dev, mspi->dma_dummy_rx, SPI_MRBLR, DMA_FROM_DEVICE); |
|---|
| 399 | 393 | dma_unmap_single(dev, mspi->dma_dummy_tx, PAGE_SIZE, DMA_TO_DEVICE); |
|---|
| 400 | 394 | cpm_muram_free(cpm_muram_offset(mspi->tx_bd)); |
|---|
| 401 | | - cpm_muram_free(cpm_muram_offset(mspi->pram)); |
|---|
| 395 | + if (!(mspi->flags & SPI_CPM1)) |
|---|
| 396 | + cpm_muram_free(cpm_muram_offset(mspi->pram)); |
|---|
| 402 | 397 | fsl_spi_free_dummy_rx(); |
|---|
| 403 | 398 | } |
|---|
| 404 | 399 | EXPORT_SYMBOL_GPL(fsl_spi_cpm_free); |
|---|