hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/drivers/mfd/tc6393xb.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * Toshiba TC6393XB SoC support
34 *
....@@ -8,10 +9,6 @@
89 *
910 * Based on code written by Sharp/Lineo for 2.4 kernels
1011 * Based on locomo.c
11
- *
12
- * This program is free software; you can redistribute it and/or modify
13
- * it under the terms of the GNU General Public License version 2 as
14
- * published by the Free Software Foundation.
1512 */
1613
1714 #include <linux/kernel.h>
....@@ -122,14 +119,13 @@
122119
123120 static int tc6393xb_nand_enable(struct platform_device *nand)
124121 {
125
- struct platform_device *dev = to_platform_device(nand->dev.parent);
126
- struct tc6393xb *tc6393xb = platform_get_drvdata(dev);
122
+ struct tc6393xb *tc6393xb = dev_get_drvdata(nand->dev.parent);
127123 unsigned long flags;
128124
129125 raw_spin_lock_irqsave(&tc6393xb->lock, flags);
130126
131127 /* SMD buffer on */
132
- dev_dbg(&dev->dev, "SMD buffer on\n");
128
+ dev_dbg(nand->dev.parent, "SMD buffer on\n");
133129 tmio_iowrite8(0xff, tc6393xb->scr + SCR_GPI_BCR(1));
134130
135131 raw_spin_unlock_irqrestore(&tc6393xb->lock, flags);
....@@ -312,8 +308,7 @@
312308
313309 int tc6393xb_lcd_set_power(struct platform_device *fb, bool on)
314310 {
315
- struct platform_device *dev = to_platform_device(fb->dev.parent);
316
- struct tc6393xb *tc6393xb = platform_get_drvdata(dev);
311
+ struct tc6393xb *tc6393xb = dev_get_drvdata(fb->dev.parent);
317312 u8 fer;
318313 unsigned long flags;
319314
....@@ -334,8 +329,7 @@
334329
335330 int tc6393xb_lcd_mode(struct platform_device *fb,
336331 const struct fb_videomode *mode) {
337
- struct platform_device *dev = to_platform_device(fb->dev.parent);
338
- struct tc6393xb *tc6393xb = platform_get_drvdata(dev);
332
+ struct tc6393xb *tc6393xb = dev_get_drvdata(fb->dev.parent);
339333 unsigned long flags;
340334
341335 raw_spin_lock_irqsave(&tc6393xb->lock, flags);
....@@ -351,8 +345,7 @@
351345
352346 static int tc6393xb_mmc_enable(struct platform_device *mmc)
353347 {
354
- struct platform_device *dev = to_platform_device(mmc->dev.parent);
355
- struct tc6393xb *tc6393xb = platform_get_drvdata(dev);
348
+ struct tc6393xb *tc6393xb = dev_get_drvdata(mmc->dev.parent);
356349
357350 tmio_core_mmc_enable(tc6393xb->scr + 0x200, 0,
358351 tc6393xb_mmc_resources[0].start & 0xfffe);
....@@ -362,8 +355,7 @@
362355
363356 static int tc6393xb_mmc_resume(struct platform_device *mmc)
364357 {
365
- struct platform_device *dev = to_platform_device(mmc->dev.parent);
366
- struct tc6393xb *tc6393xb = platform_get_drvdata(dev);
358
+ struct tc6393xb *tc6393xb = dev_get_drvdata(mmc->dev.parent);
367359
368360 tmio_core_mmc_resume(tc6393xb->scr + 0x200, 0,
369361 tc6393xb_mmc_resources[0].start & 0xfffe);
....@@ -373,16 +365,14 @@
373365
374366 static void tc6393xb_mmc_pwr(struct platform_device *mmc, int state)
375367 {
376
- struct platform_device *dev = to_platform_device(mmc->dev.parent);
377
- struct tc6393xb *tc6393xb = platform_get_drvdata(dev);
368
+ struct tc6393xb *tc6393xb = dev_get_drvdata(mmc->dev.parent);
378369
379370 tmio_core_mmc_pwr(tc6393xb->scr + 0x200, 0, state);
380371 }
381372
382373 static void tc6393xb_mmc_clk_div(struct platform_device *mmc, int state)
383374 {
384
- struct platform_device *dev = to_platform_device(mmc->dev.parent);
385
- struct tc6393xb *tc6393xb = platform_get_drvdata(dev);
375
+ struct tc6393xb *tc6393xb = dev_get_drvdata(mmc->dev.parent);
386376
387377 tmio_core_mmc_clk_div(tc6393xb->scr + 0x200, 0, state);
388378 }