forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-05-13 9d77db3c730780c8ef5ccd4b66403ff5675cfe4e
kernel/drivers/mfd/tc6387xb.c
....@@ -1,13 +1,9 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * Toshiba TC6387XB support
34 * Copyright (c) 2005 Ian Molton
45 *
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
- *
96 * This file contains TC6387XB base support.
10
- *
117 */
128
139 #include <linux/module.h>
....@@ -80,16 +76,14 @@
8076
8177 static void tc6387xb_mmc_pwr(struct platform_device *mmc, int state)
8278 {
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);
8580
8681 tmio_core_mmc_pwr(tc6387xb->scr + 0x200, 0, state);
8782 }
8883
8984 static void tc6387xb_mmc_clk_div(struct platform_device *mmc, int state)
9085 {
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);
9387
9488 tmio_core_mmc_clk_div(tc6387xb->scr + 0x200, 0, state);
9589 }
....@@ -97,8 +91,7 @@
9791
9892 static int tc6387xb_mmc_enable(struct platform_device *mmc)
9993 {
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);
10295
10396 clk_prepare_enable(tc6387xb->clk32k);
10497
....@@ -110,8 +103,7 @@
110103
111104 static int tc6387xb_mmc_disable(struct platform_device *mmc)
112105 {
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);
115107
116108 clk_disable_unprepare(tc6387xb->clk32k);
117109