diff mbox

[4/5] sprd_serial: switch comptible string to sc-uart

Message ID 1487063952-7113-5-git-send-email-chunyan.zhang@spreadtrum.com (mailing list archive)
State New, archived
Headers show

Commit Message

Chunyan Zhang Feb. 14, 2017, 9:19 a.m. UTC
This driver sprd_serial is not only for SC9836, but for all Spreadtrum
SoCs so far.

Signed-off-by: Chunyan Zhang <chunyan.chunyan@spreadtrum.com>
---
 drivers/tty/serial/sprd_serial.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Arnd Bergmann Feb. 16, 2017, 1:31 p.m. UTC | #1
On Tuesday, February 14, 2017 5:19:11 PM CET Chunyan Zhang wrote:
>  static const struct of_device_id serial_ids[] = {
> -       {.compatible = "sprd,sc9836-uart",},
> +       {.compatible = "sprd,sc-uart",},
>         {}

We really need this to be specific, in case Spreadtrum ever
makes a slightly different UART that is not 100% compatible
with this one. Also, you can't remove the string you already have,
only add to it.

Normally when you have a new chip that is compatible with one
we already have a driver for, we mark the device as compatible
with the old one and avoid having to change the driver, e.g.

	compatible = "sprd,sc9995-uart", "sprd,sc9836-uart";

This way, the driver could later be changed to handle anything
that is compatible with sc9995 differently from sc9836, but
by default it would match the original string.

	Arnd
Chunyan Zhang Feb. 17, 2017, 7:35 a.m. UTC | #2
On ε››,  2月 16, 2017 at 02:31:38δΈ‹εˆ +0100, Arnd Bergmann wrote:
> On Tuesday, February 14, 2017 5:19:11 PM CET Chunyan Zhang wrote:
> >  static const struct of_device_id serial_ids[] = {
> > -       {.compatible = "sprd,sc9836-uart",},
> > +       {.compatible = "sprd,sc-uart",},
> >         {}
> 
> We really need this to be specific, in case Spreadtrum ever
> makes a slightly different UART that is not 100% compatible
> with this one. Also, you can't remove the string you already have,
> only add to it.
>
> Normally when you have a new chip that is compatible with one
> we already have a driver for, we mark the device as compatible
> with the old one and avoid having to change the driver, e.g.
> 
> 	compatible = "sprd,sc9995-uart", "sprd,sc9836-uart";
> 
> This way, the driver could later be changed to handle anything
> that is compatible with sc9995 differently from sc9836, but
> by default it would match the original string.
> 

Right, I've addressed this when I received the same comments from
Rob Herring :)

Thanks for your comments,
Chunyan
 
> 	Arnd
diff mbox

Patch

diff --git a/drivers/tty/serial/sprd_serial.c b/drivers/tty/serial/sprd_serial.c
index 699447a..c0d63c01 100644
--- a/drivers/tty/serial/sprd_serial.c
+++ b/drivers/tty/serial/sprd_serial.c
@@ -624,7 +624,7 @@  static int __init sprd_early_console_setup(
 	device->con->write = sprd_early_write;
 	return 0;
 }
-OF_EARLYCON_DECLARE(sprd_serial, "sprd,sc9836-uart",
+OF_EARLYCON_DECLARE(sprd_serial, "sprd,sc-uart",
 		    sprd_early_console_setup);
 
 #else /* !CONFIG_SERIAL_SPRD_CONSOLE */
@@ -777,7 +777,7 @@  static int sprd_resume(struct device *dev)
 static SIMPLE_DEV_PM_OPS(sprd_pm_ops, sprd_suspend, sprd_resume);
 
 static const struct of_device_id serial_ids[] = {
-	{.compatible = "sprd,sc9836-uart",},
+	{.compatible = "sprd,sc-uart",},
 	{}
 };
 MODULE_DEVICE_TABLE(of, serial_ids);