tty: xuartps: Print warning in clock notifier
authorSoren Brinkmann <soren.brinkmann@xilinx.com>
Sat, 5 Apr 2014 00:23:40 +0000 (17:23 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 24 Apr 2014 23:21:50 +0000 (16:21 -0700)
Print a warning if the clock notifier rejects a clock frequency change
to facilitate debugging (see:
http://thread.gmane.org/gmane.linux.ports.arm.kernel/304329/focus=304379)

Signed-off-by: Soren Brinkmann <soren.brinkmann@xilinx.com>
Tested-by: Michal Simek <michal.simek@xilinx.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/xilinx_uartps.c

index 787a12064fa04a803394ce3b4a1b4842bb831265..814391038abb4b05fe35eb3ac8710fd96b9757ca 100644 (file)
@@ -429,8 +429,10 @@ static int xuartps_clk_notifier_cb(struct notifier_block *nb,
                 * frequency.
                 */
                if (!xuartps_calc_baud_divs(ndata->new_rate, xuartps->baud,
-                                       &bdiv, &cd, &div8))
+                                       &bdiv, &cd, &div8)) {
+                       dev_warn(port->dev, "clock rate change rejected\n");
                        return NOTIFY_BAD;
+               }
 
                spin_lock_irqsave(&xuartps->port->lock, flags);