diff mbox series

serial: sifive: Remove 0 from fu540-c000-uart0 binding.

Message ID 20240307090950.eLELkuyK@linutronix.de
State New
Headers show
Series serial: sifive: Remove 0 from fu540-c000-uart0 binding. | expand

Commit Message

Sebastian Andrzej Siewior March 7, 2024, 9:09 a.m. UTC
The driver is using "sifive,fu540-c000-uart0" as a binding. The device
tree and documentation states "sifive,fu540-c000-uart" instead. This
means the binding is not matched and not used.

This did not cause any problems because the alternative binding, used in
the device tree, "sifive,uart0" is not handling the hardware any
different.

Align the binding in the driver with the documentation.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
On 2024-03-06 18:48:13 [-0800], Paul Walmsley wrote:
> On Mon, 4 Mar 2024, Conor Dooley wrote:
> > I suspect that the driver is what's incorrect, given there's little
> > value in putting the IP version in the SoC-specific compatible as it's
> > a fixed implementation. I'd change the driver to match the bindings.
> 
> Agreed

I didn't add any stable/ fixes tags as I guess there is no point in
backporting this.

> - Paul

 drivers/tty/serial/sifive.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Samuel Holland March 7, 2024, 5:43 p.m. UTC | #1
Hi Conor, Sebastian,

On 2024-03-07 11:39 AM, Conor Dooley wrote:
> On Thu, Mar 07, 2024 at 10:09:50AM +0100, Sebastian Andrzej Siewior wrote:
>> The driver is using "sifive,fu540-c000-uart0" as a binding. The device
>> tree and documentation states "sifive,fu540-c000-uart" instead. This
>> means the binding is not matched and not used.
>>
>> This did not cause any problems because the alternative binding, used in
>> the device tree, "sifive,uart0" is not handling the hardware any
>> different.
>>
>> Align the binding in the driver with the documentation.
>>
>> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
>> ---
>> On 2024-03-06 18:48:13 [-0800], Paul Walmsley wrote:
>>> On Mon, 4 Mar 2024, Conor Dooley wrote:
>>>> I suspect that the driver is what's incorrect, given there's little
>>>> value in putting the IP version in the SoC-specific compatible as it's
>>>> a fixed implementation. I'd change the driver to match the bindings.
>>>
>>> Agreed
>>
> 
>> I didn't add any stable/ fixes tags as I guess there is no point in
>> backporting this.
> 
> Every documented device falls back to "sifive,uart0", as you mention
> above, so I think that's reasonable.

Right. In fact this means the sifive,fu540-c000-uart compatible can be removed
from the driver entirely, since the driver would match sifive,uart0 anyway.

Regards,
Samuel

> Reviewed-by: Conor Dooley <conor.dooley@microchip.com>
> 
> Thanks,
> Conor.
> 
>>
>>> - Paul
>>
>>  drivers/tty/serial/sifive.c | 4 ++--
>>  1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/tty/serial/sifive.c b/drivers/tty/serial/sifive.c
>> index 0670fd9f84967..cbfce65c9d221 100644
>> --- a/drivers/tty/serial/sifive.c
>> +++ b/drivers/tty/serial/sifive.c
>> @@ -761,7 +761,7 @@ static int __init early_sifive_serial_setup(struct earlycon_device *dev,
>>  }
>>  
>>  OF_EARLYCON_DECLARE(sifive, "sifive,uart0", early_sifive_serial_setup);
>> -OF_EARLYCON_DECLARE(sifive, "sifive,fu540-c000-uart0",
>> +OF_EARLYCON_DECLARE(sifive, "sifive,fu540-c000-uart",
>>  		    early_sifive_serial_setup);
>>  #endif /* CONFIG_SERIAL_EARLYCON */
>>  
>> @@ -1032,7 +1032,7 @@ static DEFINE_SIMPLE_DEV_PM_OPS(sifive_uart_pm_ops, sifive_serial_suspend,
>>  				sifive_serial_resume);
>>  
>>  static const struct of_device_id sifive_serial_of_match[] = {
>> -	{ .compatible = "sifive,fu540-c000-uart0" },
>> +	{ .compatible = "sifive,fu540-c000-uart" },
>>  	{ .compatible = "sifive,uart0" },
>>  	{},
>>  };
>> -- 
>> 2.43.0
>>
>> Sebastian
diff mbox series

Patch

diff --git a/drivers/tty/serial/sifive.c b/drivers/tty/serial/sifive.c
index 0670fd9f84967..cbfce65c9d221 100644
--- a/drivers/tty/serial/sifive.c
+++ b/drivers/tty/serial/sifive.c
@@ -761,7 +761,7 @@  static int __init early_sifive_serial_setup(struct earlycon_device *dev,
 }
 
 OF_EARLYCON_DECLARE(sifive, "sifive,uart0", early_sifive_serial_setup);
-OF_EARLYCON_DECLARE(sifive, "sifive,fu540-c000-uart0",
+OF_EARLYCON_DECLARE(sifive, "sifive,fu540-c000-uart",
 		    early_sifive_serial_setup);
 #endif /* CONFIG_SERIAL_EARLYCON */
 
@@ -1032,7 +1032,7 @@  static DEFINE_SIMPLE_DEV_PM_OPS(sifive_uart_pm_ops, sifive_serial_suspend,
 				sifive_serial_resume);
 
 static const struct of_device_id sifive_serial_of_match[] = {
-	{ .compatible = "sifive,fu540-c000-uart0" },
+	{ .compatible = "sifive,fu540-c000-uart" },
 	{ .compatible = "sifive,uart0" },
 	{},
 };