Skip to contentSkip to conversation

tty/serial: Relax the device_type restriction from of_serial

PATCH In review Grant Likely 2 participants 3 messages Feb 23, 2011 – Feb 25, 2011 TTY layer and serial drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tty/serial: Relax the device_type restriction from of_serial

There is no need to test for a device_type property in ns8250 compatible serial ports. device_type is an OpenFirmware property that is not required when using the flattened tree representation.

---
 drivers/tty/serial/of_serial.c |   18 +++++++++---------
 1 files changed, 9 insertions(+), 9 deletions(-)
drivers/tty/serial/of_serial.c +9 -9
index 5c7abe4..6a18ca6 100644
@@ -160,17 +160,17 @@ static int of_platform_serial_remove(struct platform_device *ofdev)
  * A few common types, add more as needed.
  */
 static struct of_device_id __devinitdata of_platform_serial_table[] = {
-	{ .type = "serial", .compatible = "ns8250",   .data = (void *)PORT_8250, },
-	{ .type = "serial", .compatible = "ns16450",  .data = (void *)PORT_16450, },
-	{ .type = "serial", .compatible = "ns16550a", .data = (void *)PORT_16550A, },
-	{ .type = "serial", .compatible = "ns16550",  .data = (void *)PORT_16550, },
-	{ .type = "serial", .compatible = "ns16750",  .data = (void *)PORT_16750, },
-	{ .type = "serial", .compatible = "ns16850",  .data = (void *)PORT_16850, },
+	{ .compatible = "ns8250",   .data = (void *)PORT_8250, },
+	{ .compatible = "ns16450",  .data = (void *)PORT_16450, },
+	{ .compatible = "ns16550a", .data = (void *)PORT_16550A, },
+	{ .compatible = "ns16550",  .data = (void *)PORT_16550, },
+	{ .compatible = "ns16750",  .data = (void *)PORT_16750, },
+	{ .compatible = "ns16850",  .data = (void *)PORT_16850, },
 #ifdef CONFIG_SERIAL_OF_PLATFORM_NWPSERIAL
-	{ .type = "serial", .compatible = "ibm,qpace-nwp-serial",
-					.data = (void *)PORT_NWPSERIAL, },
+	{ .compatible = "ibm,qpace-nwp-serial",
+		.data = (void *)PORT_NWPSERIAL, },
 #endif
-	{ .type = "serial",			      .data = (void *)PORT_UNKNOWN, },
+	{ .type = "serial",         .data = (void *)PORT_UNKNOWN, },
 	{ /* end of list */ },
 };
 
#1 lore raw

Hi Arnd and Ben,

I forgot to cc you guys on this patch. Greg has it in his tree, but I wanted to make sure you noticed it. If you have any objections, let me know and I'll ask Greg to drop it.

Thanks,
g.

Quoted 42 lines · Grant Likely

There is no need to test for a device_type property in ns8250 compatible serial ports.  device_type is an OpenFirmware property that is not required when using the flattened tree representation.

---
 drivers/tty/serial/of_serial.c |   18 +++++++++---------

 1 files changed, 9 insertions(+), 9 deletions(-)
drivers/tty/serial/of_serial.c +9 -9
index 5c7abe4..6a18ca6 100644
@@ -160,17 +160,17 @@ static int of_platform_serial_remove(struct platform_device *ofdev)
  * A few common types, add more as needed.
  */
  static struct of_device_id __devinitdata of_platform_serial_table[] = {
-       { .type = "serial", .compatible = "ns8250",   .data = (void *)PORT_8250, },
-       { .type = "serial", .compatible = "ns16450",  .data = (void *)PORT_16450, },
-       { .type = "serial", .compatible = "ns16550a", .data = (void *)PORT_16550A, },
-       { .type = "serial", .compatible = "ns16550",  .data = (void *)PORT_16550, },
-       { .type = "serial", .compatible = "ns16750",  .data = (void *)PORT_16750, },
-       { .type = "serial", .compatible = "ns16850",  .data = (void *)PORT_16850, },
+       { .compatible = "ns8250",   .data = (void *)PORT_8250, },
+       { .compatible = "ns16450",  .data = (void *)PORT_16450, },
+       { .compatible = "ns16550a", .data = (void *)PORT_16550A, },
+       { .compatible = "ns16550",  .data = (void *)PORT_16550, },
+       { .compatible = "ns16750",  .data = (void *)PORT_16750, },
+       { .compatible = "ns16850",  .data = (void *)PORT_16850, },
  #ifdef CONFIG_SERIAL_OF_PLATFORM_NWPSERIAL
-       { .type = "serial", .compatible = "ibm,qpace-nwp-serial",
-                                       .data = (void *)PORT_NWPSERIAL, },
+       { .compatible = "ibm,qpace-nwp-serial",
+               .data = (void *)PORT_NWPSERIAL, },
  #endif
-       { .type = "serial",                           .data = (void *)PORT_UNKNOWN, },
+       { .type = "serial",         .data = (void *)PORT_UNKNOWN, },
        { /* end of list */ },
  };
 
Signature · 2 lines
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
#2 lore raw
Quoted 5 lines · Grant Likely

Hi Arnd and Ben,

I forgot to cc you guys on this patch. Greg has it in his tree, but I wanted to make sure you noticed it. If you have any objections, let me know and I'll ask Greg to drop it.

No objection. Device-types are a thing of the past :-)

Cheers,
Ben.

Quoted 50 lines

Thanks,
g.

Quoted 42 lines · Grant Likely

There is no need to test for a device_type property in ns8250 compatible serial ports. device_type is an OpenFirmware property that is not required when using the flattened tree representation.

---
 drivers/tty/serial/of_serial.c |   18 +++++++++---------
 1 files changed, 9 insertions(+), 9 deletions(-)
drivers/tty/serial/of_serial.c +9 -9
index 5c7abe4..6a18ca6 100644
@@ -160,17 +160,17 @@ static int of_platform_serial_remove(struct platform_device *ofdev)
 * A few common types, add more as needed.
 */
 static struct of_device_id __devinitdata of_platform_serial_table[] = {
-       { .type = "serial", .compatible = "ns8250",   .data = (void *)PORT_8250, },
-       { .type = "serial", .compatible = "ns16450",  .data = (void *)PORT_16450, },
-       { .type = "serial", .compatible = "ns16550a", .data = (void *)PORT_16550A, },
-       { .type = "serial", .compatible = "ns16550",  .data = (void *)PORT_16550, },
-       { .type = "serial", .compatible = "ns16750",  .data = (void *)PORT_16750, },
-       { .type = "serial", .compatible = "ns16850",  .data = (void *)PORT_16850, },
+       { .compatible = "ns8250",   .data = (void *)PORT_8250, },
+       { .compatible = "ns16450",  .data = (void *)PORT_16450, },
+       { .compatible = "ns16550a", .data = (void *)PORT_16550A, },
+       { .compatible = "ns16550",  .data = (void *)PORT_16550, },
+       { .compatible = "ns16750",  .data = (void *)PORT_16750, },
+       { .compatible = "ns16850",  .data = (void *)PORT_16850, },
 #ifdef CONFIG_SERIAL_OF_PLATFORM_NWPSERIAL
-       { .type = "serial", .compatible = "ibm,qpace-nwp-serial",
-                                       .data = (void *)PORT_NWPSERIAL, },
+       { .compatible = "ibm,qpace-nwp-serial",
+               .data = (void *)PORT_NWPSERIAL, },
 #endif
-       { .type = "serial",                           .data = (void *)PORT_UNKNOWN, },
+       { .type = "serial",         .data = (void *)PORT_UNKNOWN, },
       { /* end of list */ },
 };