msm_serial: Switch clock consumer strings and simplify code
authorStephen Boyd <sboyd@codeaurora.org>
Wed, 21 Aug 2013 06:48:02 +0000 (23:48 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 27 Aug 2013 23:22:58 +0000 (16:22 -0700)
In downstream kernel we've standardized the clock consumer names
that MSM device drivers use. Replace the uart specific clock
names in this driver with the more standard 'core' and 'iface'
names. Also simplify the code by assuming that clk_prepare_enable
and clk_disable_unprepare() will properly check for NULL pointers
(it will because MSM uses the common clock framework).

Cc: David Brown <davidb@codeaurora.org>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/arm/mach-msm/devices-msm7x00.c
arch/arm/mach-msm/devices-msm7x30.c
arch/arm/mach-msm/devices-qsd8x50.c
drivers/tty/serial/msm_serial.c

index 6d50fb96486345b3e7dceb4275cedaada92591b2..d83404d4b3280b681b412bf90d4a120c7a566c94 100644 (file)
@@ -456,9 +456,9 @@ static struct clk_pcom_desc msm_clocks_7x01a[] = {
        CLK_PCOM("tsif_ref_clk",        TSIF_REF_CLK,   NULL, 0),
        CLK_PCOM("tv_dac_clk",  TV_DAC_CLK,     NULL, 0),
        CLK_PCOM("tv_enc_clk",  TV_ENC_CLK,     NULL, 0),
-       CLK_PCOM("uart_clk",    UART1_CLK,      "msm_serial.0", OFF),
-       CLK_PCOM("uart_clk",    UART2_CLK,      "msm_serial.1", 0),
-       CLK_PCOM("uart_clk",    UART3_CLK,      "msm_serial.2", OFF),
+       CLK_PCOM("core",        UART1_CLK,      "msm_serial.0", OFF),
+       CLK_PCOM("core",        UART2_CLK,      "msm_serial.1", 0),
+       CLK_PCOM("core",        UART3_CLK,      "msm_serial.2", OFF),
        CLK_PCOM("uart1dm_clk", UART1DM_CLK,    NULL, OFF),
        CLK_PCOM("uart2dm_clk", UART2DM_CLK,    NULL, 0),
        CLK_PCOM("usb_hs_clk",  USB_HS_CLK,     "msm_hsusb", OFF),
index d4db75acff569a7adffca73e1ef55368c49b0e9b..14e286948f69d16cddc120d90118c8d86905994e 100644 (file)
@@ -211,7 +211,7 @@ static struct clk_pcom_desc msm_clocks_7x30[] = {
        CLK_PCOM("spi_pclk",    SPI_P_CLK,      NULL, 0),
        CLK_PCOM("tv_dac_clk",  TV_DAC_CLK,     NULL, 0),
        CLK_PCOM("tv_enc_clk",  TV_ENC_CLK,     NULL, 0),
-       CLK_PCOM("uart_clk",    UART2_CLK,      "msm_serial.1", 0),
+       CLK_PCOM("core",        UART2_CLK,      "msm_serial.1", 0),
        CLK_PCOM("usb_phy_clk", USB_PHY_CLK,    NULL, 0),
        CLK_PCOM("usb_hs_clk",          USB_HS_CLK,             NULL, OFF),
        CLK_PCOM("usb_hs_pclk",         USB_HS_P_CLK,           NULL, OFF),
index f5518112284b9a67895093a625ec32263706aea0..2ed89b25d304dbfb0db69459ecafd6f1a91143cf 100644 (file)
@@ -358,9 +358,9 @@ static struct clk_pcom_desc msm_clocks_8x50[] = {
        CLK_PCOM("tsif_ref_clk",        TSIF_REF_CLK,   NULL, 0),
        CLK_PCOM("tv_dac_clk",  TV_DAC_CLK,     NULL, 0),
        CLK_PCOM("tv_enc_clk",  TV_ENC_CLK,     NULL, 0),
-       CLK_PCOM("uart_clk",    UART1_CLK,      NULL, OFF),
-       CLK_PCOM("uart_clk",    UART2_CLK,      NULL, 0),
-       CLK_PCOM("uart_clk",    UART3_CLK,      "msm_serial.2", OFF),
+       CLK_PCOM("core",        UART1_CLK,      NULL, OFF),
+       CLK_PCOM("core",        UART2_CLK,      NULL, 0),
+       CLK_PCOM("core",        UART3_CLK,      "msm_serial.2", OFF),
        CLK_PCOM("uartdm_clk",  UART1DM_CLK,    NULL, OFF),
        CLK_PCOM("uartdm_clk",  UART2DM_CLK,    NULL, 0),
        CLK_PCOM("usb_hs_clk",  USB_HS_CLK,     NULL, OFF),
index cc44ef485a2a3ad2237ab77f65b511d9f5612548..67894354dc2a2bd6653436ca27cc5ccb9cc712a9 100644 (file)
@@ -422,8 +422,7 @@ static void msm_init_clock(struct uart_port *port)
        struct msm_port *msm_port = UART_TO_MSM(port);
 
        clk_prepare_enable(msm_port->clk);
-       if (!IS_ERR(msm_port->pclk))
-               clk_prepare_enable(msm_port->pclk);
+       clk_prepare_enable(msm_port->pclk);
        msm_serial_set_mnd_regs(port);
 }
 
@@ -701,13 +700,11 @@ static void msm_power(struct uart_port *port, unsigned int state,
        switch (state) {
        case 0:
                clk_prepare_enable(msm_port->clk);
-               if (!IS_ERR(msm_port->pclk))
-                       clk_prepare_enable(msm_port->pclk);
+               clk_prepare_enable(msm_port->pclk);
                break;
        case 3:
                clk_disable_unprepare(msm_port->clk);
-               if (!IS_ERR(msm_port->pclk))
-                       clk_disable_unprepare(msm_port->pclk);
+               clk_disable_unprepare(msm_port->pclk);
                break;
        default:
                printk(KERN_ERR "msm_serial: Unknown PM state %d\n", state);
@@ -895,18 +892,12 @@ static int __init msm_serial_probe(struct platform_device *pdev)
        else
                msm_port->is_uartdm = 0;
 
-       if (msm_port->is_uartdm) {
-               msm_port->clk = devm_clk_get(&pdev->dev, "gsbi_uart_clk");
-               msm_port->pclk = devm_clk_get(&pdev->dev, "gsbi_pclk");
-       } else {
-               msm_port->clk = devm_clk_get(&pdev->dev, "uart_clk");
-               msm_port->pclk = ERR_PTR(-ENOENT);
-       }
-
+       msm_port->clk = devm_clk_get(&pdev->dev, "core");
        if (IS_ERR(msm_port->clk))
                return PTR_ERR(msm_port->clk);
 
        if (msm_port->is_uartdm) {
+               msm_port->pclk = devm_clk_get(&pdev->dev, "iface");
                if (IS_ERR(msm_port->pclk))
                        return PTR_ERR(msm_port->pclk);