.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
---|
1 | 2 | /* |
---|
2 | 3 | * Toshiba TC6393XB SoC support |
---|
3 | 4 | * |
---|
.. | .. |
---|
8 | 9 | * |
---|
9 | 10 | * Based on code written by Sharp/Lineo for 2.4 kernels |
---|
10 | 11 | * 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. |
---|
15 | 12 | */ |
---|
16 | 13 | |
---|
17 | 14 | #include <linux/kernel.h> |
---|
.. | .. |
---|
122 | 119 | |
---|
123 | 120 | static int tc6393xb_nand_enable(struct platform_device *nand) |
---|
124 | 121 | { |
---|
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); |
---|
127 | 123 | unsigned long flags; |
---|
128 | 124 | |
---|
129 | 125 | raw_spin_lock_irqsave(&tc6393xb->lock, flags); |
---|
130 | 126 | |
---|
131 | 127 | /* SMD buffer on */ |
---|
132 | | - dev_dbg(&dev->dev, "SMD buffer on\n"); |
---|
| 128 | + dev_dbg(nand->dev.parent, "SMD buffer on\n"); |
---|
133 | 129 | tmio_iowrite8(0xff, tc6393xb->scr + SCR_GPI_BCR(1)); |
---|
134 | 130 | |
---|
135 | 131 | raw_spin_unlock_irqrestore(&tc6393xb->lock, flags); |
---|
.. | .. |
---|
312 | 308 | |
---|
313 | 309 | int tc6393xb_lcd_set_power(struct platform_device *fb, bool on) |
---|
314 | 310 | { |
---|
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); |
---|
317 | 312 | u8 fer; |
---|
318 | 313 | unsigned long flags; |
---|
319 | 314 | |
---|
.. | .. |
---|
334 | 329 | |
---|
335 | 330 | int tc6393xb_lcd_mode(struct platform_device *fb, |
---|
336 | 331 | 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); |
---|
339 | 333 | unsigned long flags; |
---|
340 | 334 | |
---|
341 | 335 | raw_spin_lock_irqsave(&tc6393xb->lock, flags); |
---|
.. | .. |
---|
351 | 345 | |
---|
352 | 346 | static int tc6393xb_mmc_enable(struct platform_device *mmc) |
---|
353 | 347 | { |
---|
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); |
---|
356 | 349 | |
---|
357 | 350 | tmio_core_mmc_enable(tc6393xb->scr + 0x200, 0, |
---|
358 | 351 | tc6393xb_mmc_resources[0].start & 0xfffe); |
---|
.. | .. |
---|
362 | 355 | |
---|
363 | 356 | static int tc6393xb_mmc_resume(struct platform_device *mmc) |
---|
364 | 357 | { |
---|
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); |
---|
367 | 359 | |
---|
368 | 360 | tmio_core_mmc_resume(tc6393xb->scr + 0x200, 0, |
---|
369 | 361 | tc6393xb_mmc_resources[0].start & 0xfffe); |
---|
.. | .. |
---|
373 | 365 | |
---|
374 | 366 | static void tc6393xb_mmc_pwr(struct platform_device *mmc, int state) |
---|
375 | 367 | { |
---|
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); |
---|
378 | 369 | |
---|
379 | 370 | tmio_core_mmc_pwr(tc6393xb->scr + 0x200, 0, state); |
---|
380 | 371 | } |
---|
381 | 372 | |
---|
382 | 373 | static void tc6393xb_mmc_clk_div(struct platform_device *mmc, int state) |
---|
383 | 374 | { |
---|
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); |
---|
386 | 376 | |
---|
387 | 377 | tmio_core_mmc_clk_div(tc6393xb->scr + 0x200, 0, state); |
---|
388 | 378 | } |
---|