All of lore.kernel.org
 help / color / mirror / Atom feed
diff for duplicates of <509D362D.3040605@interlog.com>

diff --git a/a/1.txt b/N1/1.txt
index ff26804..081013b 100644
--- a/a/1.txt
+++ b/N1/1.txt
@@ -13,10 +13,3 @@ more urgent.
 Patch attached for your consideration.
 
 Signed-of-by: Douglas Gilbert <dgilbert@interlog.com>
--------------- next part --------------
-A non-text attachment was scrubbed...
-Name: atmel_serial_clk_oops.patch
-Type: text/x-patch
-Size: 2246 bytes
-Desc: not available
-URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20121109/d24da5e3/attachment.bin>
diff --git a/N1/2.hdr b/N1/2.hdr
new file mode 100644
index 0000000..eae8e92
--- /dev/null
+++ b/N1/2.hdr
@@ -0,0 +1,5 @@
+Content-Type: text/x-patch;
+ name="atmel_serial_clk_oops.patch"
+Content-Transfer-Encoding: 7bit
+Content-Disposition: attachment;
+ filename="atmel_serial_clk_oops.patch"
diff --git a/N1/2.txt b/N1/2.txt
new file mode 100644
index 0000000..d2cd4d6
--- /dev/null
+++ b/N1/2.txt
@@ -0,0 +1,66 @@
+diff --git a/drivers/tty/serial/atmel_serial.c b/drivers/tty/serial/atmel_serial.c
+index 3d7e1ee..cc385e0 100644
+--- a/drivers/tty/serial/atmel_serial.c
++++ b/drivers/tty/serial/atmel_serial.c
+@@ -1457,8 +1457,9 @@ static void __devinit atmel_of_init_port(struct atmel_uart_port *atmel_port,
+ 
+ /*
+  * Configure the port from the platform device resource info.
++ * Returns 0 for success or 1 in case of error.
+  */
+-static void __devinit atmel_init_port(struct atmel_uart_port *atmel_port,
++static int __devinit atmel_init_port(struct atmel_uart_port *atmel_port,
+ 				      struct platform_device *pdev)
+ {
+ 	struct uart_port *port = &atmel_port->uart;
+@@ -1496,6 +1497,8 @@ static void __devinit atmel_init_port(struct atmel_uart_port *atmel_port,
+ 	/* for console, the clock could already be configured */
+ 	if (!atmel_port->clk) {
+ 		atmel_port->clk = clk_get(&pdev->dev, "usart");
++		if (IS_ERR(atmel_port->clk))
++			return 1;	/* peripheral clock not found */
+ 		clk_enable(atmel_port->clk);
+ 		port->uartclk = clk_get_rate(atmel_port->clk);
+ 		clk_disable(atmel_port->clk);
+@@ -1511,6 +1514,7 @@ static void __devinit atmel_init_port(struct atmel_uart_port *atmel_port,
+ 	} else {
+ 		atmel_port->tx_done_mask = ATMEL_US_TXRDY;
+ 	}
++	return 0;
+ }
+ 
+ /*
+@@ -1666,13 +1670,18 @@ static int __init atmel_console_init(void)
+ 		struct atmel_uart_data *pdata =
+ 			atmel_default_console_device->dev.platform_data;
+ 		int id = pdata->num;
++		int ret;
+ 		struct atmel_uart_port *port = &atmel_ports[id];
+ 
+ 		port->backup_imr = 0;
+ 		port->uart.line = id;
+ 
+ 		add_preferred_console(ATMEL_DEVICENAME, id, NULL);
+-		atmel_init_port(port, atmel_default_console_device);
++		ret = atmel_init_port(port, atmel_default_console_device);
++		if (ret) {
++			pr_err("No peripheral clock for Atmel console ??\n");
++			return -EINVAL;
++		}
+ 		register_console(&atmel_console);
+ 	}
+ 
+@@ -1803,7 +1812,12 @@ static int __devinit atmel_serial_probe(struct platform_device *pdev)
+ 	port->backup_imr = 0;
+ 	port->uart.line = ret;
+ 
+-	atmel_init_port(port, pdev);
++	ret = atmel_init_port(port, pdev);
++	if (ret) {
++		ret = -EINVAL;
++		pr_err("peripheral clock not found for serial port\n");
++		goto err;
++	}
+ 
+ 	if (!atmel_use_dma_rx(&port->uart)) {
+ 		ret = -ENOMEM;
diff --git a/a/content_digest b/N1/content_digest
index 2830ef3..12aa81f 100644
--- a/a/content_digest
+++ b/N1/content_digest
@@ -1,8 +1,12 @@
- "From\0dgilbert@interlog.com (Douglas Gilbert)\0"
+ "From\0Douglas Gilbert <dgilbert@interlog.com>\0"
  "Subject\0[PATCH] atmel_serial oops when peripheral clock misconfigured\0"
  "Date\0Fri, 09 Nov 2012 11:58:21 -0500\0"
- "To\0linux-arm-kernel@lists.infradead.org\0"
- "\00:1\0"
+ "To\0linux-kernel <linux-kernel@vger.kernel.org>"
+ " Nicolas Ferre <nicolas.ferre@atmel.com>\0"
+ "Cc\0linux-arm-kernel@lists.infradead.org"
+  Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
+ " Robert Nelson <Robert.Nelson@digikey.com>\0"
+ "\01:1\0"
  "b\0"
  "In lk 3.7.0-rc4 when a peripheral clock is not found for\n"
  "a serial port the atmel_serial driver brings down the\n"
@@ -18,13 +22,75 @@
  "\n"
  "Patch attached for your consideration.\n"
  "\n"
- "Signed-of-by: Douglas Gilbert <dgilbert@interlog.com>\n"
- "-------------- next part --------------\n"
- "A non-text attachment was scrubbed...\n"
- "Name: atmel_serial_clk_oops.patch\n"
- "Type: text/x-patch\n"
- "Size: 2246 bytes\n"
- "Desc: not available\n"
- URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20121109/d24da5e3/attachment.bin>
+ Signed-of-by: Douglas Gilbert <dgilbert@interlog.com>
+ "\01:2\0"
+ "fn\0atmel_serial_clk_oops.patch\0"
+ "b\0"
+ "diff --git a/drivers/tty/serial/atmel_serial.c b/drivers/tty/serial/atmel_serial.c\n"
+ "index 3d7e1ee..cc385e0 100644\n"
+ "--- a/drivers/tty/serial/atmel_serial.c\n"
+ "+++ b/drivers/tty/serial/atmel_serial.c\n"
+ "@@ -1457,8 +1457,9 @@ static void __devinit atmel_of_init_port(struct atmel_uart_port *atmel_port,\n"
+ " \n"
+ " /*\n"
+ "  * Configure the port from the platform device resource info.\n"
+ "+ * Returns 0 for success or 1 in case of error.\n"
+ "  */\n"
+ "-static void __devinit atmel_init_port(struct atmel_uart_port *atmel_port,\n"
+ "+static int __devinit atmel_init_port(struct atmel_uart_port *atmel_port,\n"
+ " \t\t\t\t      struct platform_device *pdev)\n"
+ " {\n"
+ " \tstruct uart_port *port = &atmel_port->uart;\n"
+ "@@ -1496,6 +1497,8 @@ static void __devinit atmel_init_port(struct atmel_uart_port *atmel_port,\n"
+ " \t/* for console, the clock could already be configured */\n"
+ " \tif (!atmel_port->clk) {\n"
+ " \t\tatmel_port->clk = clk_get(&pdev->dev, \"usart\");\n"
+ "+\t\tif (IS_ERR(atmel_port->clk))\n"
+ "+\t\t\treturn 1;\t/* peripheral clock not found */\n"
+ " \t\tclk_enable(atmel_port->clk);\n"
+ " \t\tport->uartclk = clk_get_rate(atmel_port->clk);\n"
+ " \t\tclk_disable(atmel_port->clk);\n"
+ "@@ -1511,6 +1514,7 @@ static void __devinit atmel_init_port(struct atmel_uart_port *atmel_port,\n"
+ " \t} else {\n"
+ " \t\tatmel_port->tx_done_mask = ATMEL_US_TXRDY;\n"
+ " \t}\n"
+ "+\treturn 0;\n"
+ " }\n"
+ " \n"
+ " /*\n"
+ "@@ -1666,13 +1670,18 @@ static int __init atmel_console_init(void)\n"
+ " \t\tstruct atmel_uart_data *pdata =\n"
+ " \t\t\tatmel_default_console_device->dev.platform_data;\n"
+ " \t\tint id = pdata->num;\n"
+ "+\t\tint ret;\n"
+ " \t\tstruct atmel_uart_port *port = &atmel_ports[id];\n"
+ " \n"
+ " \t\tport->backup_imr = 0;\n"
+ " \t\tport->uart.line = id;\n"
+ " \n"
+ " \t\tadd_preferred_console(ATMEL_DEVICENAME, id, NULL);\n"
+ "-\t\tatmel_init_port(port, atmel_default_console_device);\n"
+ "+\t\tret = atmel_init_port(port, atmel_default_console_device);\n"
+ "+\t\tif (ret) {\n"
+ "+\t\t\tpr_err(\"No peripheral clock for Atmel console ??\\n\");\n"
+ "+\t\t\treturn -EINVAL;\n"
+ "+\t\t}\n"
+ " \t\tregister_console(&atmel_console);\n"
+ " \t}\n"
+ " \n"
+ "@@ -1803,7 +1812,12 @@ static int __devinit atmel_serial_probe(struct platform_device *pdev)\n"
+ " \tport->backup_imr = 0;\n"
+ " \tport->uart.line = ret;\n"
+ " \n"
+ "-\tatmel_init_port(port, pdev);\n"
+ "+\tret = atmel_init_port(port, pdev);\n"
+ "+\tif (ret) {\n"
+ "+\t\tret = -EINVAL;\n"
+ "+\t\tpr_err(\"peripheral clock not found for serial port\\n\");\n"
+ "+\t\tgoto err;\n"
+ "+\t}\n"
+ " \n"
+ " \tif (!atmel_use_dma_rx(&port->uart)) {\n"
+ " \t\tret = -ENOMEM;"
 
-dca354d76efdeb8dba7cc218c85b2fe8db51507f832cb00d5c6b1e27025ce41f
+85786de2c7aca6c501d40662ff57ec5c16da5368b59b78d638eb65bdb9565b2f

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.