aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/tty
diff options
context:
space:
mode:
authorSoren Brinkmann <soren.brinkmann@xilinx.com>2013-10-21 19:41:01 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-10-29 12:26:11 -0400
commit7ac57347c23de6b6fcaf8f0a1f91067cedea57bc (patch)
treefdebde47330da13e7ca8a5de496e88f7929a9369 /drivers/tty
parentd3641f64bc71765682754722fd42fae24366bb3a (diff)
tty: xuartps: Fix build error when COMMON_CLK is not set
Clock notifiers are only available when CONFIG_COMMON_CLK is enabled. Hence all notifier related code has to be protected by corresponsing ifdefs. Signed-off-by: Soren Brinkmann <soren.brinkmann@xilinx.com> Reported-by: kbuild test robot <fengguang.wu@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty')
-rw-r--r--drivers/tty/serial/xilinx_uartps.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/tty/serial/xilinx_uartps.c b/drivers/tty/serial/xilinx_uartps.c
index ca4a2f1fbca9..e46e9f3f19b9 100644
--- a/drivers/tty/serial/xilinx_uartps.c
+++ b/drivers/tty/serial/xilinx_uartps.c
@@ -411,6 +411,7 @@ static unsigned int xuartps_set_baud_rate(struct uart_port *port,
411 return calc_baud; 411 return calc_baud;
412} 412}
413 413
414#ifdef CONFIG_COMMON_CLK
414/** 415/**
415 * xuartps_clk_notitifer_cb - Clock notifier callback 416 * xuartps_clk_notitifer_cb - Clock notifier callback
416 * @nb: Notifier block 417 * @nb: Notifier block
@@ -504,6 +505,7 @@ static int xuartps_clk_notifier_cb(struct notifier_block *nb,
504 return NOTIFY_DONE; 505 return NOTIFY_DONE;
505 } 506 }
506} 507}
508#endif
507 509
508/*----------------------Uart Operations---------------------------*/ 510/*----------------------Uart Operations---------------------------*/
509 511
@@ -1380,11 +1382,13 @@ static int xuartps_probe(struct platform_device *pdev)
1380 goto err_out_clk_disable; 1382 goto err_out_clk_disable;
1381 } 1383 }
1382 1384
1385#ifdef CONFIG_COMMON_CLK
1383 xuartps_data->clk_rate_change_nb.notifier_call = 1386 xuartps_data->clk_rate_change_nb.notifier_call =
1384 xuartps_clk_notifier_cb; 1387 xuartps_clk_notifier_cb;
1385 if (clk_notifier_register(xuartps_data->refclk, 1388 if (clk_notifier_register(xuartps_data->refclk,
1386 &xuartps_data->clk_rate_change_nb)) 1389 &xuartps_data->clk_rate_change_nb))
1387 dev_warn(&pdev->dev, "Unable to register clock notifier.\n"); 1390 dev_warn(&pdev->dev, "Unable to register clock notifier.\n");
1391#endif
1388 1392
1389 /* Initialize the port structure */ 1393 /* Initialize the port structure */
1390 port = xuartps_get_port(); 1394 port = xuartps_get_port();
@@ -1415,8 +1419,10 @@ static int xuartps_probe(struct platform_device *pdev)
1415 } 1419 }
1416 1420
1417err_out_notif_unreg: 1421err_out_notif_unreg:
1422#ifdef CONFIG_COMMON_CLK
1418 clk_notifier_unregister(xuartps_data->refclk, 1423 clk_notifier_unregister(xuartps_data->refclk,
1419 &xuartps_data->clk_rate_change_nb); 1424 &xuartps_data->clk_rate_change_nb);
1425#endif
1420err_out_clk_disable: 1426err_out_clk_disable:
1421 clk_disable_unprepare(xuartps_data->refclk); 1427 clk_disable_unprepare(xuartps_data->refclk);
1422err_out_clk_dis_aper: 1428err_out_clk_dis_aper:
@@ -1438,8 +1444,10 @@ static int xuartps_remove(struct platform_device *pdev)
1438 int rc; 1444 int rc;
1439 1445
1440 /* Remove the xuartps port from the serial core */ 1446 /* Remove the xuartps port from the serial core */
1447#ifdef CONFIG_COMMON_CLK
1441 clk_notifier_unregister(xuartps_data->refclk, 1448 clk_notifier_unregister(xuartps_data->refclk,
1442 &xuartps_data->clk_rate_change_nb); 1449 &xuartps_data->clk_rate_change_nb);
1450#endif
1443 rc = uart_remove_one_port(&xuartps_uart_driver, port); 1451 rc = uart_remove_one_port(&xuartps_uart_driver, port);
1444 port->mapbase = 0; 1452 port->mapbase = 0;
1445 clk_disable_unprepare(xuartps_data->refclk); 1453 clk_disable_unprepare(xuartps_data->refclk);