]> git.karo-electronics.de Git - linux-beck.git/commitdiff
serial: use dev_get_platdata()
authorJingoo Han <jg1.han@samsung.com>
Tue, 30 Jul 2013 08:06:57 +0000 (17:06 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 1 Aug 2013 00:56:15 +0000 (17:56 -0700)
Use the wrapper function for retrieving the platform data instead of
accessing dev->platform_data directly.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
22 files changed:
drivers/tty/serial/8250/8250_core.c
drivers/tty/serial/altera_jtaguart.c
drivers/tty/serial/altera_uart.c
drivers/tty/serial/amba-pl010.c
drivers/tty/serial/amba-pl011.c
drivers/tty/serial/ar933x_uart.c
drivers/tty/serial/arc_uart.c
drivers/tty/serial/atmel_serial.c
drivers/tty/serial/bfin_sport_uart.c
drivers/tty/serial/bfin_uart.c
drivers/tty/serial/ifx6x60.c
drivers/tty/serial/imx.c
drivers/tty/serial/max3100.c
drivers/tty/serial/mcf.c
drivers/tty/serial/mpsc.c
drivers/tty/serial/msm_serial_hs.c
drivers/tty/serial/omap-serial.c
drivers/tty/serial/samsung.c
drivers/tty/serial/sc26xx.c
drivers/tty/serial/serial_txx9.c
drivers/tty/serial/sh-sci.c
drivers/tty/serial/vr41xx_siu.c

index 86c00b1c55836b3c52801c9d79bccef489c728d2..570df9d2a5d2f46afc72a23d1e373f2c5aa4f3ba 100644 (file)
@@ -3062,7 +3062,7 @@ void serial8250_resume_port(int line)
  */
 static int serial8250_probe(struct platform_device *dev)
 {
-       struct plat_serial8250_port *p = dev->dev.platform_data;
+       struct plat_serial8250_port *p = dev_get_platdata(&dev->dev);
        struct uart_8250_port uart;
        int ret, i, irqflag = 0;
 
index c6bdb943726b0494a9deab39a5be591edb76cf9a..2299a34225d452ee948bc89cb18cbaf72d8029a6 100644 (file)
@@ -408,7 +408,8 @@ static struct uart_driver altera_jtaguart_driver = {
 
 static int altera_jtaguart_probe(struct platform_device *pdev)
 {
-       struct altera_jtaguart_platform_uart *platp = pdev->dev.platform_data;
+       struct altera_jtaguart_platform_uart *platp =
+                       dev_get_platdata(&pdev->dev);
        struct uart_port *port;
        struct resource *res_irq, *res_mem;
        int i = pdev->id;
index 1d46966e2a65cc742c8d8920fe8004d4bcad3a48..fa638db9a98c8f4d2985c5907ba3aed4fdc59c4f 100644 (file)
@@ -534,7 +534,7 @@ static int altera_uart_get_of_uartclk(struct platform_device *pdev,
 
 static int altera_uart_probe(struct platform_device *pdev)
 {
-       struct altera_uart_platform_uart *platp = pdev->dev.platform_data;
+       struct altera_uart_platform_uart *platp = dev_get_platdata(&pdev->dev);
        struct uart_port *port;
        struct resource *res_mem;
        struct resource *res_irq;
index c3684051952778b568cbe73177196d12a7ef7f38..8b90f0b6dfdfe7838c43863350d93f9fccc41dae 100644 (file)
@@ -721,7 +721,7 @@ static int pl010_probe(struct amba_device *dev, const struct amba_id *id)
        uap->port.flags = UPF_BOOT_AUTOCONF;
        uap->port.line = i;
        uap->dev = dev;
-       uap->data = dev->dev.platform_data;
+       uap->data = dev_get_platdata(&dev->dev);
 
        amba_ports[i] = uap;
 
index 28b35ad9c6cd361818d94c0cde6ee2aa987979c0..eb38fb851b4ec5596fca6c8ede7e6fb4d471e7a8 100644 (file)
@@ -265,7 +265,7 @@ static void pl011_sgbuf_free(struct dma_chan *chan, struct pl011_sgbuf *sg,
 static void pl011_dma_probe_initcall(struct device *dev, struct uart_amba_port *uap)
 {
        /* DMA is the sole user of the platform data right now */
-       struct amba_pl011_data *plat = uap->port.dev->platform_data;
+       struct amba_pl011_data *plat = dev_get_platdata(uap->port.dev);
        struct dma_slave_config tx_conf = {
                .dst_addr = uap->port.mapbase + UART01x_DR,
                .dst_addr_width = DMA_SLAVE_BUSWIDTH_1_BYTE,
@@ -1497,10 +1497,10 @@ static int pl011_hwinit(struct uart_port *port)
        uap->im = readw(uap->port.membase + UART011_IMSC);
        writew(UART011_RTIM | UART011_RXIM, uap->port.membase + UART011_IMSC);
 
-       if (uap->port.dev->platform_data) {
+       if (dev_get_platdata(uap->port.dev)) {
                struct amba_pl011_data *plat;
 
-               plat = uap->port.dev->platform_data;
+               plat = dev_get_platdata(uap->port.dev);
                if (plat->init)
                        plat->init();
        }
@@ -1645,10 +1645,10 @@ static void pl011_shutdown(struct uart_port *port)
        /* Optionally let pins go into sleep states */
        pinctrl_pm_select_sleep_state(port->dev);
 
-       if (uap->port.dev->platform_data) {
+       if (dev_get_platdata(uap->port.dev)) {
                struct amba_pl011_data *plat;
 
-               plat = uap->port.dev->platform_data;
+               plat = dev_get_platdata(uap->port.dev);
                if (plat->exit)
                        plat->exit();
        }
@@ -2002,10 +2002,10 @@ static int __init pl011_console_setup(struct console *co, char *options)
        if (ret)
                return ret;
 
-       if (uap->port.dev->platform_data) {
+       if (dev_get_platdata(uap->port.dev)) {
                struct amba_pl011_data *plat;
 
-               plat = uap->port.dev->platform_data;
+               plat = dev_get_platdata(uap->port.dev);
                if (plat->init)
                        plat->init();
        }
index 9824dfb1e4fe601ab5ee50f3951a69eaed3e5eb0..7aa9062153e8cc4c2c0ba0565ab2ff79efbd7092 100644 (file)
@@ -629,7 +629,7 @@ static int ar933x_uart_probe(struct platform_device *pdev)
        int id;
        int ret;
 
-       pdata = pdev->dev.platform_data;
+       pdata = dev_get_platdata(&pdev->dev);
        if (!pdata)
                return -EINVAL;
 
index cbf1d155b7b2a8c80ef782443edbf77c0e7f5595..2f195f0d7a11cfb4ed476357f8c47febf17d6560 100644 (file)
@@ -528,7 +528,7 @@ arc_uart_init_one(struct platform_device *pdev, int dev_id)
        unsigned long *plat_data;
        struct arc_uart_port *uart = &arc_uart_ports[dev_id];
 
-       plat_data = ((unsigned long *)(pdev->dev.platform_data));
+       plat_data = (unsigned long *)dev_get_platdata(&pdev->dev);
        if (!plat_data)
                return -ENODEV;
 
index 7e2cb31497c3f7fbd82720e4607befe1e02b33aa..d067285a2d203765d38d36535d588854988f75c2 100644 (file)
@@ -1393,7 +1393,7 @@ static int atmel_init_property(struct atmel_uart_port *atmel_port,
                                struct platform_device *pdev)
 {
        struct device_node *np = pdev->dev.of_node;
-       struct atmel_uart_data *pdata = pdev->dev.platform_data;
+       struct atmel_uart_data *pdata = dev_get_platdata(&pdev->dev);
 
        if (np) {
                /* DMA/PDC usage specification */
@@ -1437,7 +1437,7 @@ static void atmel_init_rs485(struct atmel_uart_port *atmel_port,
                                struct platform_device *pdev)
 {
        struct device_node *np = pdev->dev.of_node;
-       struct atmel_uart_data *pdata = pdev->dev.platform_data;
+       struct atmel_uart_data *pdata = dev_get_platdata(&pdev->dev);
 
        if (np) {
                u32 rs485_delay[2];
@@ -2028,7 +2028,7 @@ static int atmel_init_port(struct atmel_uart_port *atmel_port,
 {
        int ret;
        struct uart_port *port = &atmel_port->uart;
-       struct atmel_uart_data *pdata = pdev->dev.platform_data;
+       struct atmel_uart_data *pdata = dev_get_platdata(&pdev->dev);
 
        if (!atmel_init_property(atmel_port, pdev))
                atmel_set_ops(port);
@@ -2226,7 +2226,7 @@ static int __init atmel_console_init(void)
        int ret;
        if (atmel_default_console_device) {
                struct atmel_uart_data *pdata =
-                       atmel_default_console_device->dev.platform_data;
+                       dev_get_platdata(&atmel_default_console_device->dev);
                int id = pdata->num;
                struct atmel_uart_port *port = &atmel_ports[id];
 
@@ -2334,7 +2334,7 @@ static int atmel_serial_probe(struct platform_device *pdev)
 {
        struct atmel_uart_port *port;
        struct device_node *np = pdev->dev.of_node;
-       struct atmel_uart_data *pdata = pdev->dev.platform_data;
+       struct atmel_uart_data *pdata = dev_get_platdata(&pdev->dev);
        void *data;
        int ret = -ENODEV;
 
index 487c173b0f72f107f1c671175908e47936f98186..424ed36c26f1c4ec9652b2cd77c91162307d7de1 100644 (file)
@@ -766,7 +766,8 @@ static int sport_uart_probe(struct platform_device *pdev)
                }
 
                ret = peripheral_request_list(
-                       (unsigned short *)pdev->dev.platform_data, DRV_NAME);
+                       (unsigned short *)dev_get_platdata(&pdev->dev),
+                       DRV_NAME);
                if (ret) {
                        dev_err(&pdev->dev,
                                "Fail to request SPORT peripherals\n");
@@ -843,7 +844,7 @@ out_error_unmap:
                iounmap(sport->port.membase);
 out_error_free_peripherals:
                peripheral_free_list(
-                       (unsigned short *)pdev->dev.platform_data);
+                       (unsigned short *)dev_get_platdata(&pdev->dev));
 out_error_free_mem:
                kfree(sport);
                bfin_sport_uart_ports[pdev->id] = NULL;
@@ -863,7 +864,7 @@ static int sport_uart_remove(struct platform_device *pdev)
                uart_remove_one_port(&sport_uart_reg, &sport->port);
                iounmap(sport->port.membase);
                peripheral_free_list(
-                       (unsigned short *)pdev->dev.platform_data);
+                       (unsigned short *)dev_get_platdata(&pdev->dev));
                kfree(sport);
                bfin_sport_uart_ports[pdev->id] = NULL;
        }
index 72031d754dc096847b3c6d30c64a7adc897243ee..378f3c383992bd991f93e993a60909011f0eefe0 100644 (file)
@@ -1240,7 +1240,8 @@ static int bfin_serial_probe(struct platform_device *pdev)
                         */
 #endif
                ret = peripheral_request_list(
-                       (unsigned short *)pdev->dev.platform_data, DRIVER_NAME);
+                       (unsigned short *)dev_get_platdata(&pdev->dev),
+                       DRIVER_NAME);
                if (ret) {
                        dev_err(&pdev->dev,
                                "fail to request bfin serial peripherals\n");
@@ -1358,7 +1359,7 @@ out_error_unmap:
                iounmap(uart->port.membase);
 out_error_free_peripherals:
                peripheral_free_list(
-                       (unsigned short *)pdev->dev.platform_data);
+                       (unsigned short *)dev_get_platdata(&pdev->dev));
 out_error_free_mem:
                kfree(uart);
                bfin_serial_ports[pdev->id] = NULL;
@@ -1377,7 +1378,7 @@ static int bfin_serial_remove(struct platform_device *pdev)
                uart_remove_one_port(&bfin_serial_reg, &uart->port);
                iounmap(uart->port.membase);
                peripheral_free_list(
-                       (unsigned short *)pdev->dev.platform_data);
+                       (unsigned short *)dev_get_platdata(&pdev->dev));
                kfree(uart);
                bfin_serial_ports[pdev->id] = NULL;
        }
@@ -1432,7 +1433,7 @@ static int bfin_earlyprintk_probe(struct platform_device *pdev)
        }
 
        ret = peripheral_request_list(
-               (unsigned short *)pdev->dev.platform_data, DRIVER_NAME);
+               (unsigned short *)dev_get_platdata(&pdev->dev), DRIVER_NAME);
        if (ret) {
                dev_err(&pdev->dev,
                                "fail to request bfin serial peripherals\n");
@@ -1463,7 +1464,7 @@ static int bfin_earlyprintk_probe(struct platform_device *pdev)
 
 out_error_free_peripherals:
        peripheral_free_list(
-               (unsigned short *)pdev->dev.platform_data);
+               (unsigned short *)dev_get_platdata(&pdev->dev));
 
        return ret;
 }
index 8b1534c424afc38eb022d26d7ba70b25e6b722d4..af286e6713eb914ccf30f334b69706a6510b1b97 100644 (file)
@@ -1008,7 +1008,7 @@ static int ifx_spi_spi_probe(struct spi_device *spi)
                return -ENODEV;
        }
 
-       pl_data = (struct ifx_modem_platform_data *)spi->dev.platform_data;
+       pl_data = (struct ifx_modem_platform_data *)dev_get_platdata(&spi->dev);
        if (!pl_data) {
                dev_err(&spi->dev, "missing platform data!");
                return -ENODEV;
index 90655b875baba65f5a0c3ccf0c7ab83e9e982640..a5f32c7c6c66c6ef8bc889c157b8b2d2d35ba5a2 100644 (file)
@@ -1222,7 +1222,7 @@ static int imx_startup(struct uart_port *port)
 
        if (USE_IRDA(sport)) {
                struct imxuart_platform_data *pdata;
-               pdata = sport->port.dev->platform_data;
+               pdata = dev_get_platdata(sport->port.dev);
                sport->irda_inv_rx = pdata->irda_inv_rx;
                sport->irda_inv_tx = pdata->irda_inv_tx;
                sport->trcv_delay = pdata->transceiver_delay;
@@ -1265,7 +1265,7 @@ static void imx_shutdown(struct uart_port *port)
 
        if (USE_IRDA(sport)) {
                struct imxuart_platform_data *pdata;
-               pdata = sport->port.dev->platform_data;
+               pdata = dev_get_platdata(sport->port.dev);
                if (pdata->irda_enable)
                        pdata->irda_enable(0);
        }
@@ -1925,7 +1925,7 @@ static inline int serial_imx_probe_dt(struct imx_port *sport,
 static void serial_imx_probe_pdata(struct imx_port *sport,
                struct platform_device *pdev)
 {
-       struct imxuart_platform_data *pdata = pdev->dev.platform_data;
+       struct imxuart_platform_data *pdata = dev_get_platdata(&pdev->dev);
 
        sport->port.line = pdev->id;
        sport->devdata = (struct imx_uart_data  *) pdev->id_entry->driver_data;
@@ -2000,7 +2000,7 @@ static int serial_imx_probe(struct platform_device *pdev)
 
        imx_ports[sport->port.line] = sport;
 
-       pdata = pdev->dev.platform_data;
+       pdata = dev_get_platdata(&pdev->dev);
        if (pdata && pdata->init) {
                ret = pdata->init(pdev);
                if (ret)
@@ -2024,7 +2024,7 @@ static int serial_imx_remove(struct platform_device *pdev)
        struct imxuart_platform_data *pdata;
        struct imx_port *sport = platform_get_drvdata(pdev);
 
-       pdata = pdev->dev.platform_data;
+       pdata = dev_get_platdata(&pdev->dev);
 
        uart_remove_one_port(&imx_reg, &sport->port);
 
index 35866d5872ad1c82bdc487909cd359a84dabb790..79f9a9eff5455e561d3cdb98e57d0aee16281d38 100644 (file)
@@ -779,7 +779,7 @@ static int max3100_probe(struct spi_device *spi)
        max3100s[i]->irq = spi->irq;
        spin_lock_init(&max3100s[i]->conf_lock);
        spi_set_drvdata(spi, max3100s[i]);
-       pdata = spi->dev.platform_data;
+       pdata = dev_get_platdata(&spi->dev);
        max3100s[i]->crystal = pdata->crystal;
        max3100s[i]->loopback = pdata->loopback;
        max3100s[i]->poll_time = pdata->poll_time * HZ / 1000;
index 65be0c00c4bff3f802549a23dfe34515a5a03b54..a2e97c96e1597388413bb38c15ade5d3793e2345 100644 (file)
@@ -24,6 +24,7 @@
 #include <linux/serial_core.h>
 #include <linux/io.h>
 #include <linux/uaccess.h>
+#include <linux/platform_device.h>
 #include <asm/coldfire.h>
 #include <asm/mcfsim.h>
 #include <asm/mcfuart.h>
@@ -644,7 +645,7 @@ static struct uart_driver mcf_driver = {
 
 static int mcf_probe(struct platform_device *pdev)
 {
-       struct mcf_platform_uart *platp = pdev->dev.platform_data;
+       struct mcf_platform_uart *platp = dev_get_platdata(&pdev->dev);
        struct uart_port *port;
        int i;
 
index bc24f4931670d1e70d9bda922a2d3d0341636e0f..fba52578d02f34495c977b183cf0e3b44185f7e9 100644 (file)
@@ -1884,7 +1884,7 @@ static int mpsc_shared_drv_probe(struct platform_device *dev)
        if (dev->id == 0) {
                if (!(rc = mpsc_shared_map_regs(dev))) {
                        pdata = (struct mpsc_shared_pdata *)
-                               dev->dev.platform_data;
+                               dev_get_platdata(&dev->dev);
 
                        mpsc_shared_regs.MPSC_MRR_m = pdata->mrr_val;
                        mpsc_shared_regs.MPSC_RCRR_m= pdata->rcrr_val;
@@ -2025,7 +2025,7 @@ static void mpsc_drv_get_platform_data(struct mpsc_port_info *pi,
 {
        struct mpsc_pdata       *pdata;
 
-       pdata = (struct mpsc_pdata *)pd->dev.platform_data;
+       pdata = (struct mpsc_pdata *)dev_get_platdata(&pd->dev);
 
        pi->port.uartclk = pdata->brg_clk_freq;
        pi->port.iotype = UPIO_MEM;
index 4ca2f64861e6ce531546f996a5a1bf3718af0344..48e94961a9e572e96bc8e553ea5e420296d2b1a8 100644 (file)
@@ -1618,7 +1618,7 @@ static int msm_hs_probe(struct platform_device *pdev)
        struct msm_hs_port *msm_uport;
        struct resource *resource;
        const struct msm_serial_hs_platform_data *pdata =
-                                               pdev->dev.platform_data;
+                                               dev_get_platdata(&pdev->dev);
 
        if (pdev->id < 0 || pdev->id >= UARTDM_NR) {
                printk(KERN_ERR "Invalid plaform device ID = %d\n", pdev->id);
index c77bf0cf268448d53545ad7d602df489435c212c..c7517063eb9baec20a95d0cb71604848d3b8a4d0 100644 (file)
@@ -200,7 +200,7 @@ static inline void serial_omap_clear_fifos(struct uart_omap_port *up)
 
 static int serial_omap_get_context_loss_count(struct uart_omap_port *up)
 {
-       struct omap_uart_port_info *pdata = up->dev->platform_data;
+       struct omap_uart_port_info *pdata = dev_get_platdata(up->dev);
 
        if (!pdata || !pdata->get_context_loss_count)
                return -EINVAL;
@@ -210,7 +210,7 @@ static int serial_omap_get_context_loss_count(struct uart_omap_port *up)
 
 static void serial_omap_enable_wakeup(struct uart_omap_port *up, bool enable)
 {
-       struct omap_uart_port_info *pdata = up->dev->platform_data;
+       struct omap_uart_port_info *pdata = dev_get_platdata(up->dev);
 
        if (!pdata || !pdata->enable_wakeup)
                return;
@@ -1409,7 +1409,7 @@ static int serial_omap_probe(struct platform_device *pdev)
 {
        struct uart_omap_port   *up;
        struct resource         *mem, *irq;
-       struct omap_uart_port_info *omap_up_info = pdev->dev.platform_data;
+       struct omap_uart_port_info *omap_up_info = dev_get_platdata(&pdev->dev);
        int ret;
 
        if (pdev->dev.of_node) {
index 376079b9bd75f77bac213cfcb8e419740bc12a4d..019b9154d7d45514667f16ad6608a196894e9179 100644 (file)
@@ -1250,8 +1250,8 @@ static int s3c24xx_serial_probe(struct platform_device *pdev)
 
        ourport->baudclk = ERR_PTR(-EINVAL);
        ourport->info = ourport->drv_data->info;
-       ourport->cfg = (pdev->dev.platform_data) ?
-                       (struct s3c2410_uartcfg *)pdev->dev.platform_data :
+       ourport->cfg = (dev_get_platdata(&pdev->dev)) ?
+                       (struct s3c2410_uartcfg *)dev_get_platdata(&pdev->dev) :
                        ourport->drv_data->def_cfg;
 
        ourport->port.fifosize = (ourport->info->fifosize) ?
index 4b1434d53e9d6ddbe9c478f0631379c527abf31a..887b4f7707490362e9647b767dfe1fbc7fed07b4 100644 (file)
@@ -637,7 +637,7 @@ static int sc26xx_probe(struct platform_device *dev)
 {
        struct resource *res;
        struct uart_sc26xx_port *up;
-       unsigned int *sc26xx_data = dev->dev.platform_data;
+       unsigned int *sc26xx_data = dev_get_platdata(&dev->dev);
        int err;
 
        res = platform_get_resource(dev, IORESOURCE_MEM, 0);
index fe48a0c2b4cab88c4b1bdb4d3ef09aa93dd0d4b2..440a962412da9251c10aa60ee6cf25cf2624474a 100644 (file)
@@ -1097,7 +1097,7 @@ static void serial_txx9_unregister_port(int line)
  */
 static int serial_txx9_probe(struct platform_device *dev)
 {
-       struct uart_port *p = dev->dev.platform_data;
+       struct uart_port *p = dev_get_platdata(&dev->dev);
        struct uart_port port;
        int ret, i;
 
index 7477e0ea5cdb886607e023ae06ce8cc92bb2edde..72ca870f8e5733a8e77488dc2d4c25743056edbd 100644 (file)
@@ -2380,7 +2380,7 @@ static char early_serial_buf[32];
 
 static int sci_probe_earlyprintk(struct platform_device *pdev)
 {
-       struct plat_sci_port *cfg = pdev->dev.platform_data;
+       struct plat_sci_port *cfg = dev_get_platdata(&pdev->dev);
 
        if (early_serial_console.data)
                return -EEXIST;
index f655997f44af21328db8dfcd750402ef6f10a6d7..a63c14bc9a24a2be5c59bd95d1f0643bc3ed8f9b 100644 (file)
@@ -705,7 +705,7 @@ static int siu_init_ports(struct platform_device *pdev)
 {
        struct uart_port *port;
        struct resource *res;
-       int *type = pdev->dev.platform_data;
+       int *type = dev_get_platdata(&pdev->dev);
        int i;
 
        if (!type)