.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
---|
1 | 2 | /* |
---|
2 | 3 | * Freescale/Motorola Coldfire Queued SPI driver |
---|
3 | 4 | * |
---|
4 | 5 | * Copyright 2010 Steven King <sfking@fdwdc.com> |
---|
5 | | - * |
---|
6 | | - * This program is free software; you can redistribute it and/or modify |
---|
7 | | - * it under the terms of the GNU General Public License as published by |
---|
8 | | - * the Free Software Foundation; either version 2 of the License, or |
---|
9 | | - * (at your option) any later version. |
---|
10 | | - * |
---|
11 | | - * This program is distributed in the hope that it will be useful, |
---|
12 | | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
13 | | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
14 | | - * GNU General Public License for more details. |
---|
15 | 6 | */ |
---|
16 | 7 | |
---|
17 | 8 | #include <linux/kernel.h> |
---|
.. | .. |
---|
348 | 339 | { |
---|
349 | 340 | struct spi_master *master; |
---|
350 | 341 | struct mcfqspi *mcfqspi; |
---|
351 | | - struct resource *res; |
---|
352 | 342 | struct mcfqspi_platform_data *pdata; |
---|
353 | 343 | int status; |
---|
354 | 344 | |
---|
.. | .. |
---|
371 | 361 | |
---|
372 | 362 | mcfqspi = spi_master_get_devdata(master); |
---|
373 | 363 | |
---|
374 | | - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
---|
375 | | - mcfqspi->iobase = devm_ioremap_resource(&pdev->dev, res); |
---|
| 364 | + mcfqspi->iobase = devm_platform_ioremap_resource(pdev, 0); |
---|
376 | 365 | if (IS_ERR(mcfqspi->iobase)) { |
---|
377 | 366 | status = PTR_ERR(mcfqspi->iobase); |
---|
378 | 367 | goto fail0; |
---|
.. | .. |
---|
398 | 387 | status = PTR_ERR(mcfqspi->clk); |
---|
399 | 388 | goto fail0; |
---|
400 | 389 | } |
---|
401 | | - clk_enable(mcfqspi->clk); |
---|
| 390 | + clk_prepare_enable(mcfqspi->clk); |
---|
402 | 391 | |
---|
403 | 392 | master->bus_num = pdata->bus_num; |
---|
404 | 393 | master->num_chipselect = pdata->num_chipselect; |
---|
.. | .. |
---|
436 | 425 | pm_runtime_disable(&pdev->dev); |
---|
437 | 426 | mcfqspi_cs_teardown(mcfqspi); |
---|
438 | 427 | fail1: |
---|
439 | | - clk_disable(mcfqspi->clk); |
---|
| 428 | + clk_disable_unprepare(mcfqspi->clk); |
---|
440 | 429 | fail0: |
---|
441 | 430 | spi_master_put(master); |
---|
442 | 431 | |
---|
.. | .. |
---|
455 | 444 | mcfqspi_wr_qmr(mcfqspi, MCFQSPI_QMR_MSTR); |
---|
456 | 445 | |
---|
457 | 446 | mcfqspi_cs_teardown(mcfqspi); |
---|
458 | | - clk_disable(mcfqspi->clk); |
---|
| 447 | + clk_disable_unprepare(mcfqspi->clk); |
---|
459 | 448 | |
---|
460 | 449 | return 0; |
---|
461 | 450 | } |
---|