.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
---|
1 | 2 | /* |
---|
2 | 3 | * Toshiba TC6387XB support |
---|
3 | 4 | * Copyright (c) 2005 Ian Molton |
---|
4 | 5 | * |
---|
5 | | - * This program is free software; you can redistribute it and/or modify |
---|
6 | | - * it under the terms of the GNU General Public License version 2 as |
---|
7 | | - * published by the Free Software Foundation. |
---|
8 | | - * |
---|
9 | 6 | * This file contains TC6387XB base support. |
---|
10 | | - * |
---|
11 | 7 | */ |
---|
12 | 8 | |
---|
13 | 9 | #include <linux/module.h> |
---|
.. | .. |
---|
80 | 76 | |
---|
81 | 77 | static void tc6387xb_mmc_pwr(struct platform_device *mmc, int state) |
---|
82 | 78 | { |
---|
83 | | - struct platform_device *dev = to_platform_device(mmc->dev.parent); |
---|
84 | | - struct tc6387xb *tc6387xb = platform_get_drvdata(dev); |
---|
| 79 | + struct tc6387xb *tc6387xb = dev_get_drvdata(mmc->dev.parent); |
---|
85 | 80 | |
---|
86 | 81 | tmio_core_mmc_pwr(tc6387xb->scr + 0x200, 0, state); |
---|
87 | 82 | } |
---|
88 | 83 | |
---|
89 | 84 | static void tc6387xb_mmc_clk_div(struct platform_device *mmc, int state) |
---|
90 | 85 | { |
---|
91 | | - struct platform_device *dev = to_platform_device(mmc->dev.parent); |
---|
92 | | - struct tc6387xb *tc6387xb = platform_get_drvdata(dev); |
---|
| 86 | + struct tc6387xb *tc6387xb = dev_get_drvdata(mmc->dev.parent); |
---|
93 | 87 | |
---|
94 | 88 | tmio_core_mmc_clk_div(tc6387xb->scr + 0x200, 0, state); |
---|
95 | 89 | } |
---|
.. | .. |
---|
97 | 91 | |
---|
98 | 92 | static int tc6387xb_mmc_enable(struct platform_device *mmc) |
---|
99 | 93 | { |
---|
100 | | - struct platform_device *dev = to_platform_device(mmc->dev.parent); |
---|
101 | | - struct tc6387xb *tc6387xb = platform_get_drvdata(dev); |
---|
| 94 | + struct tc6387xb *tc6387xb = dev_get_drvdata(mmc->dev.parent); |
---|
102 | 95 | |
---|
103 | 96 | clk_prepare_enable(tc6387xb->clk32k); |
---|
104 | 97 | |
---|
.. | .. |
---|
110 | 103 | |
---|
111 | 104 | static int tc6387xb_mmc_disable(struct platform_device *mmc) |
---|
112 | 105 | { |
---|
113 | | - struct platform_device *dev = to_platform_device(mmc->dev.parent); |
---|
114 | | - struct tc6387xb *tc6387xb = platform_get_drvdata(dev); |
---|
| 106 | + struct tc6387xb *tc6387xb = dev_get_drvdata(mmc->dev.parent); |
---|
115 | 107 | |
---|
116 | 108 | clk_disable_unprepare(tc6387xb->clk32k); |
---|
117 | 109 | |
---|