.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
---|
1 | 2 | /* |
---|
2 | 3 | * |
---|
3 | 4 | * Toshiba T7L66XB core mfd support |
---|
4 | 5 | * |
---|
5 | 6 | * Copyright (c) 2005, 2007, 2008 Ian Molton |
---|
6 | 7 | * Copyright (c) 2008 Dmitry Baryshkov |
---|
7 | | - * |
---|
8 | | - * This program is free software; you can redistribute it and/or modify |
---|
9 | | - * it under the terms of the GNU General Public License version 2 as |
---|
10 | | - * published by the Free Software Foundation. |
---|
11 | 8 | * |
---|
12 | 9 | * T7L66 features: |
---|
13 | 10 | * |
---|
.. | .. |
---|
82 | 79 | |
---|
83 | 80 | static int t7l66xb_mmc_enable(struct platform_device *mmc) |
---|
84 | 81 | { |
---|
85 | | - struct platform_device *dev = to_platform_device(mmc->dev.parent); |
---|
86 | | - struct t7l66xb *t7l66xb = platform_get_drvdata(dev); |
---|
| 82 | + struct t7l66xb *t7l66xb = dev_get_drvdata(mmc->dev.parent); |
---|
87 | 83 | unsigned long flags; |
---|
88 | 84 | u8 dev_ctl; |
---|
89 | 85 | int ret; |
---|
.. | .. |
---|
108 | 104 | |
---|
109 | 105 | static int t7l66xb_mmc_disable(struct platform_device *mmc) |
---|
110 | 106 | { |
---|
111 | | - struct platform_device *dev = to_platform_device(mmc->dev.parent); |
---|
112 | | - struct t7l66xb *t7l66xb = platform_get_drvdata(dev); |
---|
| 107 | + struct t7l66xb *t7l66xb = dev_get_drvdata(mmc->dev.parent); |
---|
113 | 108 | unsigned long flags; |
---|
114 | 109 | u8 dev_ctl; |
---|
115 | 110 | |
---|
.. | .. |
---|
128 | 123 | |
---|
129 | 124 | static void t7l66xb_mmc_pwr(struct platform_device *mmc, int state) |
---|
130 | 125 | { |
---|
131 | | - struct platform_device *dev = to_platform_device(mmc->dev.parent); |
---|
132 | | - struct t7l66xb *t7l66xb = platform_get_drvdata(dev); |
---|
| 126 | + struct t7l66xb *t7l66xb = dev_get_drvdata(mmc->dev.parent); |
---|
133 | 127 | |
---|
134 | 128 | tmio_core_mmc_pwr(t7l66xb->scr + 0x200, 0, state); |
---|
135 | 129 | } |
---|
136 | 130 | |
---|
137 | 131 | static void t7l66xb_mmc_clk_div(struct platform_device *mmc, int state) |
---|
138 | 132 | { |
---|
139 | | - struct platform_device *dev = to_platform_device(mmc->dev.parent); |
---|
140 | | - struct t7l66xb *t7l66xb = platform_get_drvdata(dev); |
---|
| 133 | + struct t7l66xb *t7l66xb = dev_get_drvdata(mmc->dev.parent); |
---|
141 | 134 | |
---|
142 | 135 | tmio_core_mmc_clk_div(t7l66xb->scr + 0x200, 0, state); |
---|
143 | 136 | } |
---|
.. | .. |
---|
412 | 405 | |
---|
413 | 406 | static int t7l66xb_remove(struct platform_device *dev) |
---|
414 | 407 | { |
---|
415 | | - struct t7l66xb_platform_data *pdata = dev_get_platdata(&dev->dev); |
---|
416 | 408 | struct t7l66xb *t7l66xb = platform_get_drvdata(dev); |
---|
417 | | - int ret; |
---|
418 | 409 | |
---|
419 | | - ret = pdata->disable(dev); |
---|
420 | 410 | clk_disable_unprepare(t7l66xb->clk48m); |
---|
421 | 411 | clk_put(t7l66xb->clk48m); |
---|
422 | 412 | clk_disable_unprepare(t7l66xb->clk32k); |
---|
.. | .. |
---|
427 | 417 | mfd_remove_devices(&dev->dev); |
---|
428 | 418 | kfree(t7l66xb); |
---|
429 | 419 | |
---|
430 | | - return ret; |
---|
431 | | - |
---|
| 420 | + return 0; |
---|
432 | 421 | } |
---|
433 | 422 | |
---|
434 | 423 | static struct platform_driver t7l66xb_platform_driver = { |
---|